Questions tagged [contract-deployment]

The act of pushing a compiled smart contract in byte code to the Ethereum blockchain.

Filter by
Sorted by
Tagged with
78
votes
5answers
24k views

How is the address of an Ethereum contract computed?

How is the address of an Ethereum contract computed? What use cases are there for knowing a contract's address in advance?
19
votes
2answers
6k views

Deploying the Greeter contract via the geth CLI is not registering in my private blockchain

I am running a local private Ethereum blockchain using: geth --networkid 60098 --genesis CustomGenesis.json --nodiscover --maxpeers 0 --rpc --rpccorsdomain "http://localhost:3000" --datadir "./data" ...
23
votes
3answers
17k views

Calling function from deployed contract

I want to know how to instantiate an existing contract deployed on the blockchain using its address. e.g: contract A { function f1() {} } A is deployed on the blockchain, and in contract B I ...
12
votes
4answers
4k views

How to Compile and Deploy a Smart Contract without running a full node?

I'm new to solidity and smart contract programming. I have already made and deploy smart contracts successfully, but always using Mist. Now I'm not able to do so, because I can't complete a node ...
49
votes
7answers
7k views

How can I verify that a contract on the blockchain matches the source code?

Given the (Solidity) source code of a smart contract, is there a way to deterministically compile the code and compare it with the code on the blockchain? I want to verify that the contract does what ...
15
votes
2answers
5k views

Truffle Migrations Account Locked Error with --network command

I have started a private blockchain using the command, geth --networkid 1337 --datadir ~/home/xyz/testnet --ipcpath /home/xyz/.ethereum/geth.ipc --rpc --rpcapi eth,web3 --rpcport 8545 --rpcaddr ...
10
votes
1answer
2k views

Bytecode on block chain different from the one used when deploying

When I deploy a contract from node.js using the web3 JavaScript API (connected to a locally running geth), and then check the deployed bytecode using eth.getCode(address) (either from the JS console ...
7
votes
1answer
1k views

How to call Library Function from a Contract? => [error] The contract code couldn't be stored, please check your gas amount. undefined

When I compiled following code at "https://ethereum.github.io/browser-solidity/" it gives me two Web3 deploy code for: var libraryContract = web3.eth.contract(...); //Web3 deploy code var ...
15
votes
1answer
4k views

Deploying contract with constructor arguments via Geth RPC

How can I deploy a compiled contract with constructor arguments using geth rpc? I have tested my call deployed the compiled contract bytecode just fine, I just don't understand how I can pass ...
16
votes
6answers
12k views

Encoding/Decoding contract ABI data

How to encode and decode ABI data? Can someone show me an example with web3js library?
14
votes
4answers
2k views

Error: The contract code couldn't be stored, please check your gas amount

I am using the below code to create the contact it give the error: Error: The contract code couldn't be stored, please check your gas amount. Code: primaryAccount = web3.eth.accounts[0]; //...
17
votes
1answer
9k views

At which point the smart contracts get executed?

Let's say I sent a transaction to invoke a smart contract (to its address). At which point will the smart contract get executed? Is it during the transaction validation process? Also, is there any ...
31
votes
2answers
4k views

Do contracts also have a nonce?

Do contracts also have a nonce and if so how is it calculated? Usual accounts have a nonce that is increased with every transaction. However, contracts can't make transactions, they can only make ...
12
votes
2answers
4k views

How to pass constructor parameters to a contract using Truffle?

I am using testrpc and truffle for deploying contracts.I want to pass constructor parameters while deploying. contract User { string public userName; function User(string ...
6
votes
3answers
3k views

Block gas limit exceeded when compiling contract Solidity browser

Using Solidity Browser ( https://ethereum.github.io/browser-solidity/ ) to mine a contract on testnet with injected web3 and metamask account, throws this error: callback contain no result Gas ...
3
votes
1answer
2k views

Greeter variables are all undefined and contract doesn't run

I'm attempting to run the greeter contract on the live network. I'm following the commands as per the official tutorial, which worked on a test network when I tried it a while ago (on a different ...
5
votes
1answer
3k views

Interaction with a deployed smart contract from the geth command line

I have a contract which I'd like to be able to sum numbers submitted by any other address: contract UnitCounter { mapping (address => uint256) public UnitsFrom; uint256 public TotalUnits; ...
7
votes
2answers
707 views

Is there any limitation for the number of the return values from Solidity functions?

Answer of this question (https://ethereum.stackexchange.com/a/3590/4575) says that: "I am not allowed to return dynamic arrays from Solidity functions yet." On the other hand, Solidity supports ...
6
votes
1answer
2k views

How can I deploy a contract with reference to a library contract without using a graphical user interface like Browser Solidity?

I am using Solidity Browser to deploy a contract due to from Library contract method failing #2831 issue. On this following answer https://ethereum.stackexchange.com/a/9181/4575 I have guided to use ...
6
votes
1answer
3k views

How many contract are currently deployed on the Ethereum blockchain?

I was recently asked what percentage of transactions represent smart contract deployments on Ethereum, and had no immediate answer. It is probably easier to ask how many contracts are currently ...
5
votes
3answers
2k views

Why is my Greeter contract not mined on --testnet?

I'm working on the contracts tutorial. Here's the code (including contract): var greeterSource = 'contract mortal { address owner; function mortal() { owner = msg.sender; } function kill() { if (msg....
17
votes
5answers
17k views

How to find contract's address?

I successfully setup a private blockchain and created the "hello world" contract according to tutorial from etherium web site. One thing that I can't figure out is how to find the contract later. I ...
12
votes
1answer
1k views

Out of gas during contract creation

A few days ago, several attempts at creating a contract failed with out of gas errors (confirmed by etherscan/ethercamp and getBalance API), however it is not clear to me what failed exactly, and how ...
6
votes
5answers
2k views

How to deploy contract to the Ropsten test-net using web3.js

I am newbie in solidity. I don't understand what steps I must do for deploy contract in the Ropsten test-net. This is my contract: pragma solidity ^0.4.15; import './ERC20.sol'; import './SafeMath....
8
votes
1answer
3k views

Return Token Contract address on truffle deploy

I am trying to figure out how to return the address of a contract when I deploy it with truffle's deployer.deploy. So the goal is that when I deploy a contract that is a custom token, I want to ...
5
votes
1answer
4k views

How to deploy contract into local running node using solidity browser?

I am running a local ethereum node and I did unlock an account. Now I want to use the solidity browser to deploy that contract, but when I switch to the web3 provider deploy option and I press the ...
15
votes
2answers
3k views

How to get Source code of an already deployed contract?

How can I retrieve the solidity code of an already published contract in the mist wallet?
8
votes
2answers
5k views

How to get the contract ABI in new Remix IDE?

Waked up today just to find out the remix browser interface changed to this what happened !!? I cannot find the contract details to get the json interface anymore.
4
votes
3answers
2k views

How do I determine whether the transaction is used for the contract creation?

I want to monitor Ethereum and memorise every contract published on the blockchain (basically the same thing that Etherscan does). How it is possible to do this using NodeJS & web3? How can I ...
4
votes
2answers
539 views

Can an ENS name point to a contract address?

I know that an ethereum wallet address can have a ENS (Ethereum Name Service) name, but it is possible for a contract? So instead of giving the contract address is it possible to give the contract's ...
3
votes
3answers
3k views

How to kill crowdsale contract?

I want to just simply kill this contract what code do i type into the get console to kill this contract so that the funds are returned to the owner which is me. Please let me know how you did it so I ...
1
vote
1answer
293 views

truffle deploy: Network state unknown when geth is synced

eth.syncing false eth.blockNumber 5199029 truffle deploy --network=live Running migration: 1_initial_migration.js Deploying Migrations... ... undefined Error encountered, bailing. Network state ...
1
vote
1answer
63 views

Zero knowledge contingent payment on etherum?

I know that bitcoin supports Zero knowledge contingent payment (ZKCP) , can etherum support such ZKCP Payment ?
12
votes
1answer
454 views

Is there a way to detect which compiler version produced a contract binary?

Given the compiled bytecode on the blockchain, is there a way to detect which compiler version is being used in order to verify source matches bytecode without having to bruteforce all available ...
8
votes
1answer
2k views

Why does this Oraclize query only works once?

Why this code works one time? First time I get proper random number, but after that I get wallet response "Data can't be executed, so it will use all provided gas" I'm in Testnet. contract ...
6
votes
2answers
2k views

Who pays gas for smart contracts?

I'm currently writing my first smart contract and I'm trying to figure out how to inject gas into the contract, of course, if it's possible. I'm not sure If I got it correctly. With every transaction ...
5
votes
4answers
920 views

Unhandled promise rejection(gas limit) when deploying Contract to rinkeby using truffle-hdwallet-provider

I am trying to Deploy a beginners contract onto the rinkeby test network through Infura node. It is throwing the following error. (node:35183) UnhandledPromiseRejectionWarning: Unhandled promise ...
5
votes
3answers
891 views

Do I need to be synced to the blockchain to create a contract?

I haven't been able to run the Greeter contract on the live network and am referring to these excellent Q&As for guidance. I have a feeling that it's because my client hasn't finished syncing with ...
4
votes
1answer
558 views

Understanding TokenCreator/OwnedToken example from Solidity documentation

Here's the page containing the example https://solidity.readthedocs.io Here are two contracts that are supposed to work together(my questions are below): Here's how I think it works. Please correct ...
4
votes
1answer
473 views

Is there any way to re-deploy, to the same address, a contract that wasn't deployed due to an out-of-gas error?

Suppose that you deployed a contract, but your transaction got canceled due to an out-of-gas error. Is there any way to re-deploy the contract so that it takes the same address?
3
votes
5answers
3k views

Is there a way to extract ABI from a deployed contract?

I am building a web UI for testing smart contracts and currently I have to supply the ABI for a contract I test. Is there a way to extract the ABI from a deployed contract (preferably programmatically)...
2
votes
0answers
719 views

What can I do about an “Invalid sender” contract deployment error?

When deploying a smart contract, I get this message: "Error: invalid sender undefined." See details below. Why is this happening? What do I need to do differently? I wrote the smart contract below ...
2
votes
3answers
203 views

How are end-users meant to build trust towards smart contracts (and their originators)?

One of the benefits commonly associated with Ethereum is that it allows end-users to interact directly with smart contracts and thereby removing the need for trusted-third-parties. In cases where: ...
2
votes
1answer
4k views

Testing contracts with truffle

I'm trying to write tests for contracts using truffle; I have opened an issue here. The workflow is as follows: mkdir truffle_testing truffle init rm -r tests/* contracts/* build/* Next, I create ...
1
vote
1answer
432 views

why contracts can't be deployed on my private chain using geth CLI?

I tried to use the geth CLI(the eth.contract command line) to deploy a new contract to my private chain, but why is there no response even no transactions received by the chain according to the log ...
1
vote
1answer
103 views

What does etherscan mean by “Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)”?

I'm inspecting a contract on etherscan, at the following URL: https://etherscan.io/address/0x5cb5f46a655c02889172323760d12d0e5d83cdaf#code At the bottom of the web-page, I see two sections: ...
1
vote
1answer
128 views

What value to set for Web3 provider when dapp is deployed to Heroku or other Hosting site

I am trying to host my dapp on Heroku and smart contract on Rinkeby network. My dapp has a front end in node.js and jquery and an express backend server that I use to listen to solidity events and to '...
0
votes
1answer
72 views

What is wrong with this code, deployed but showing error while sending ether?

I have tried to compile this code for crowdsale and also have deployed the contract on Rinkeby Network. But each time I send a transaction, it says Warning! Error Encounter during Contract Execution [...
17
votes
2answers
6k views

Canceling / overwriting a pending transaction using geth JSON RPC

This is a private network A transaction was sent to create a contract using the eth_sendTransaction RPC call. The transaction is "removed" marked "will be removed" because it ran out of gas but ...
12
votes
1answer
5k views

How to write my first Solidity “Hello World” smart contract?

I have never written a smart contract before because there is a lot attached to it getting it working. But I finally want to learn it now. I want to write a simple mininmal working smart contract ...