Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [contract-development]

Questions regarding the development of smart contracts

1
vote
1answer
31 views

How does Transactions work in Ethereum Virtual Machine?

While reading the transactions sections of EVM documentation many questions raised in my head: If the target account is not set (the transaction does not have a recipient or the recipient is set ...
0
votes
1answer
25 views

estimateGas for function calls

Can someone suggest me how to use estimateGas for function calls like below: await (MyContract.methods.addDoc(id,sha256hash).send({from: coinbase[0],gas: 1000000})
1
vote
1answer
49 views

Asset based transfer Solidity Contract

I am trying to create asset based transfer Smart contract by solidity language. i'm using ethereum. functions are Create assets (land_id, land_size, land_price) with a ownership of contract owner. ...
2
votes
1answer
30 views

Add more logic to a payable function

Is it possible to include in a payable function a message such as "Transaction rejected - Company not registered" which is displayed when a transaction is rejected? My code is as per below: ...
1
vote
1answer
24 views

Interacting with dapps using wrapper smart contract (and not personal accounts)

Metamask (or other browser plug-in) helps a lot the user to submit transactions using his personal account since it manages his private keys. When interacting with an dapp front-end, web3 will ...
2
votes
1answer
31 views

How to install Oyente on Windows 10?

Can some body please guide me how to install Oyente on Windows 10? I have found Oyente for Linux but not for windows on github. Some body please guide me. Zulfi.
1
vote
1answer
27 views

Fail to verify source code on Etherscan using API with constructor arguments

I am trying to verify source code on etherscan using API listed here. I have successfully verified the simple contracts (without constructor). Now I am trying to verify a sample contract with ...
0
votes
1answer
18 views

Function of emitting event [duplicate]

I've recently started with Solidity and like to know about the emit event as I wasn't sure of why it is being used in the program. contract MyToken { string public name; string public symbol;...
0
votes
2answers
34 views

Refund Ether stored in a Contract

i'm trying to store Ether inside a Contract and refund it when I call the function paypackEther(). Inside of the Remix IDE with the JavaScript VM it works perfectly, but when I execute it on Rinkeby ...
1
vote
1answer
37 views

Unable to schedule a call using Aion Recurring Contract

So here's the contract that I deployed on Ropsten Network. I took code refer from here. pragma solidity ^0.4.24; // interface Aion contract Aion { uint256 public serviceFee; function ...
0
votes
1answer
33 views

Difference between Binary of the Contracts in Hex and contract bytecode?

I use the command "solcjs --bin mycontract.sol" to get the "Binary of the contracts in hex" and it looks like: It can be used as a parameter of evm in geth after the command "evm --code". When I use ...
1
vote
1answer
19 views

Parameter's Value visibility

Is the value of a contract's method's parameter visible on blockchain? On Etherscan, in the tx information there is an Input Data field, which details says The binary data that formed the input of ...
1
vote
0answers
29 views

Where is the bytecode of smart contract stored ? And how to get it executed?

Well, my question is terse but to the point: Where's the bytecode of smart contract stored? And how to get it executed ? From the image and Ethereum Yellow Paper we can see there is codeHash in ...
2
votes
1answer
23 views

Where does Ethereum node store its variant? [duplicate]

It's known to all that once the smart contract is deployed to the Ethereum network, it won't be modified. But what about the value of a contact's variant? Say a smart contract looks like: ... ...
-1
votes
0answers
9 views

how to watch every event in contract even after the wocket is disconnected?

I am working on a nodejs cli app, it requried loop events in contracts, do some progress write result to database. (I write a json file to recode which block it processed to ) But it still miss some ...
1
vote
1answer
54 views

Getting an error while trying to store large payloads (13-20kB)

I've created a simple smart contract to store large amounts of data (13-20kB) on the Ethereum blockchain. But when I'm trying to make a transaction they fail sometimes (with little correlation to the ...
3
votes
1answer
980 views

Source File requires different compiler version

I am using solidity version "pragma solidity ^0.4.20;". When I checked JSON files of contract, compiler version shows : "compiler": { "name": "solc", "version": "0.4.21+commit.dfe3193c....
1
vote
0answers
29 views

How to run smart contract using go-ethereum source code?

mycontract.sol pragma solidity ^0.5.0; contract HelloWorld { uint256 counter = 100; function add() public { counter++; } function subtract() public { counter--; } ...
0
votes
1answer
25 views

What happens when run in command line: geth?

I set up geth and then I run: geth. It seems to be downloading something ? So what the heck is it doing ?
1
vote
0answers
20 views

Possible ERC-20 improvement: Token-specific ENS equivalent

With ENS still providing quite a difficult user experience for the average user, I'm wondering why standards like ERC-20 don't implement a simple mapping allowing people to set names equivalent to ...
0
votes
1answer
50 views

How do smart contract communicate with other?

As we all know that an external account can send a transaction to smart contract. But I'm confused when it comes to how contracts talk with each other. Contracts that exist within the global scope ...
1
vote
1answer
52 views

Estimate Gas For Smart Contract Always Fails

I have deployed a very simple contract to the Ethereum blockchain to be able to split a payment across two different outputs. pragma solidity ^0.5.0; contract MoonTrade { function multiSendETH( ...
2
votes
2answers
30 views

Make Smart Contract Only Accessible from a Web App

I have got a Solidity smart contract which only interacts with a React front-end using web3. I want to restrict access to the smart contract so that only the React front-end can access the smart ...
0
votes
1answer
18 views

getting the latest holders address:balance for a smart contract

I managed to get all the transfer events from any given smart contract, but now I need to reduce that to current holder any idea how I would do this? Here is my code so far: import ERC20ABI from './...
1
vote
2answers
52 views

Is it possible to split single Solidity contract across multiple files? [duplicate]

My team is currently working on a single smart contract that contains multiple functions that share state. We are using Git, and are constantly facing merge conflicts. The best way to reduce conflicts ...
0
votes
1answer
58 views

The use of ERC20 tokens in a private ethereum network

I am being told to use a private blockchain instead of the public one in attempt to cut gas cost. But I was hit with the problem of the value of ether and tokens in this private blockchain. I am ...
0
votes
1answer
24 views

Smart contract function throwing error in remix

I am writing a PreICO Smart contract. I got a code snippet which I am trying to understand. I am stuck in function buyXYZTokens function which is throwing error. Here is the code snippet: Contract ...
1
vote
0answers
37 views

Modifier to only allow access via staticcall

I'm trying to create a modifier that only allows a function to be called using staticcall. Using the view declaration in Solidity 0.5.0 guarantees that a function won't change state, but it still ...
1
vote
1answer
46 views

In OpenZeppelin _deliverTokens() from CrowdSale contract is not called

I am using openZeppelin for creating the ICO contract. Could you please help me to understand the below behaviour ? Crowdsale The CrowdSale contract is having the function buyTokens(). It calls the ...
1
vote
2answers
51 views

Can't return an array of addresses

I'm trying to get all the products (their addresses) belonging to a specific Handler but can't get it to work... It compiles fine, returns the _name and _additionalInformation properly but not ...
0
votes
1answer
20 views

What is a suitable pattern for mobile/web apps that leverage ether?

Looking to understand how to build an app that leverages Ethereum - what suitable patterns are out there (ideally to go via some tutorials). I'd like to build a Hello World simple app (mobile and/or ...
0
votes
1answer
37 views

How to deploy contract with local private key?

I am trying to deploy my contract onto the blockchain in my private network with local private key (no wallet: I used web3.auto.w3.account.create()). I know how to send normal transaction with local ...
1
vote
1answer
21 views

Ethereum Smart Contract deployed token not showing

pragma solidity ^0.4.24; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); ...
1
vote
1answer
28 views

Smart Contract To Send Multiple Outputs

I'm learning about smart contracts currently and a bit confused as to how they really work. My website allows users to send ETH from their wallet on site to another address off site. During which I'd ...
2
votes
2answers
85 views

How can I trigger a quorum private smart contract deployment from my js client app?

My question follows directly this answer to a similar question. I need for my client app users to be able to trigger private contract deployment. I've tried using privateFor with both the web3 and ...
-1
votes
1answer
93 views

Trying to figure out this 2 ETH smart contract quiz

Does anyone know whether this smart contract can be broken? Is there some trick behind this? https://etherscan.io/address/0xfc62a32da21052fb3086e8f68ad10a7118a98606
2
votes
1answer
26 views

How to add more logic to a payable function?

How can I add to a payable function the possibility for the buyer (a company, in my case) to add some details about itself at the moment of performing the payment (e.g. registered number and company ...
1
vote
3answers
60 views

How can import one contract functions in solidity

Looking at the solidity documentation i don´t find a date type. Searching in the web I find a GitHub repo that appear one contract that give the posibility to work with date. https://github.com/...
1
vote
1answer
36 views

IPFS Versioning for dynamic content

is it possible to keep versioning in IPFS? Like im saving one row of record like pid:1, mid:3, status: started --> v1 pid:1, mid:3 status;completed --> v1.1 is there any way to implement ...
0
votes
1answer
51 views

Ethereum and traceability [closed]

I'm trying to understand Solidity language in deep. I'm thinking in a traceability test project. But before start the first question appear in my mind. If I want to attach the production flow of one ...
1
vote
1answer
56 views

How to implement Ethereum mixing (or coin tumbling) to preserve anonymity in smart contracts?

According to this answer: (https://ethereum.stackexchange.com/a/62694/23024) one of the approaches to anonymize users in smart contracts is: "writing a smart contract which accepts Ether ...
1
vote
1answer
38 views

How to set limit on erc20 token

I want to set limit on erc20 token that owner will not transfer after the set limit. Lets totallSupply =1000 tokens But transfer function could not be able to transfer more than 500 tokens. Please ...
2
votes
0answers
27 views

Information/documentation about get data access from smart contract [closed]

I have been reading about giving data access from a smart contract, but I could not find good and precise documentation/information about that. I would like to make a smart contract where a user gives ...
1
vote
2answers
80 views

Efficient way of checking and inserting array address that is unqiue

I have a following requirement that need to be cater in dapp. Insert array of address The array need to be unique. If one of the array address already exists, reject and revert entire operation. ...
0
votes
1answer
44 views

How to refund a wallet address from a contract with solidity and web3

I am building an app where I'd like a purchaser to be able to seek a refund from the contract. Essentially I am trying to transfer eth from a contract to a wallet. When I get to the point of issuing a ...
1
vote
0answers
21 views

Challenges of Contract design [closed]

I am about to start designing a smart contract intended to be the backbone of a platform in the finance domain. My question is what are the challenges and problems that I may face or have to deal ...
0
votes
1answer
13 views

Gas deduction on contract creation inside a contract

I want to create a Contract (TokenTimelock from Open Zeppelin) inside of a registry contract. It seems as if my contract needs gas to do this. So I am wondering about using delegate call because I ...
0
votes
1answer
43 views

what is contract type in solidity and what is the use of it

contract DappToken { string public name = "MDV"; string public symbol = "$$$"; string public standard = "DApp Token v1.0"; uint256 public totalSupply; // ...
0
votes
0answers
15 views

How to pass arguments inside Oraclize API URL?

I am trying to call Oraclize API URL. I saw many codes related to the same. One of the example I explained below. function update(){ oraclize_query(60, "URL", "json(http://api.fixer.io/latest?...
0
votes
1answer
25 views

how to pass value to contract via php (no java script)?

I wrote a contract that get a unit and do something My question : How to pass a value to this contract function via PHP? (not js,py,MetaMask, ... . just in php) For example, I use this and install ...