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
75
votes
5answers
22k 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" ...
10
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 ...
22
votes
3answers
16k 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 ...
47
votes
7answers
6k 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 ...
13
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
1k 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 ...
14
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 ...
15
votes
6answers
11k views

Encoding/Decoding contract ABI data

How to encode and decode ABI data? Can someone show me an example with web3js library?
13
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]; //...
14
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 ...
30
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 ...
11
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
666 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
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 ...
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 ...
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
4answers
16k 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 ...
11
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 ...
14
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
474 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
278 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
58 views

Zero knowledge contingent payment on etherum?

I know that bitcoin supports Zero knowledge contingent payment (ZKCP) , can etherum support such ZKCP Payment ?
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
3answers
886 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 ...
5
votes
4answers
885 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 ...
4
votes
1answer
457 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?
4
votes
1answer
545 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 ...
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
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 ...
2
votes
0answers
689 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
197 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: ...
1
vote
1answer
87 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
114 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 '...
1
vote
1answer
431 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 ...
0
votes
1answer
68 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 [...
15
votes
2answers
5k 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 ...
11
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 ...
9
votes
1answer
2k views

How to edit a contract that has already been deployed? [duplicate]

I have been writing my first few contracts. So, as I understand it, once you write, compile, and deploy your contract, the only way to then interact with that contract is via something like web3.js ...