Questions tagged [contract-deployment]
The act of pushing a compiled smart contract in byte code to the Ethereum blockchain.
199
questions
133
votes
7
answers
70k
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?
20
votes
2
answers
7k
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" ...
30
votes
4
answers
32k
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 ...
15
votes
1
answer
4k
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 ...
14
votes
5
answers
6k
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 ...
64
votes
7
answers
16k
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 ...
17
votes
1
answer
3k
views
What's the difference between solc's bin bytecode versus bin runtime?
Solc says that bin-runtime is the runtime part of the contracts. What exactly is the runtime bytecode part and how does it differ from bin bytecode output?
29
votes
5
answers
22k
views
What is the real price of deploying a contract on the Mainnet?
I'm trying to deploy a contract on the mainnet, but I've been getting some issues deploying with Truffle.
➜ ballot git:(master) ✗ truffle migrate --network mainnet --dry-run
Using network 'mainnet' (...
24
votes
7
answers
34k
views
Encoding/Decoding contract ABI data
How to encode and decode ABI data?
Can someone show me an example with web3js library?
15
votes
2
answers
6k
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 ...
7
votes
1
answer
2k
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
1
answer
5k
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 ...
14
votes
5
answers
3k
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];
//...
3
votes
3
answers
2k
views
Brownie cannot locate deploy.py script
I have python installed on my system (Windows) with Anaconda from a prior course I had taken which may be the root cause of the issue. I'm at the stage where I need to run a deploy.py script to deploy ...
41
votes
2
answers
9k
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 ...
23
votes
1
answer
14k
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 ...
19
votes
2
answers
11k
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
3
answers
4k
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
1
answer
3k
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 ...
46
votes
3
answers
22k
views
How to write an optimized (gas-cost) smart contract?
As we all know, there are many factors that determine a good smart contract, such as:
Security: it has minimal/zero vulnerability so they cannot be exploited by an adversary. Immune to Attacks.
Cost:...
13
votes
1
answer
4k
views
How to generate a vanity address for a smart contract to be deployed on?
I am aware of the possibility to generate vanity addresses for normal accounts. However, how is possible to generate vanity addresses for external owned accounts (which host smart contracts)?
I'm ...
11
votes
2
answers
7k
views
How big could a contract be?
I am trying to figure out how big could a contract be? Is it possible to have 10k functions? One million? More?
Is there any restriction on the function's body size?
Does a bigger contract need ...
7
votes
2
answers
2k
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 ...
7
votes
1
answer
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
2
answers
4k
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;
...
6
votes
1
answer
4k
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
3
answers
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....
4
votes
1
answer
818
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
2
answers
2k
views
Ethers js deploy contract with balance, payable constructor
I have a smart contract with a payable constructor. I'm trying to figure out the syntax with ethers js how I can deploy the smart contract and send an initial balance with the deployment.
const ...
2
votes
2
answers
6k
views
ethers.js Recover public key from contract deployment via v,r,s values
I'm currently trying to get the public key of the user that deploys a contract. Unfortunately I can't make it work.
I am trying to achieve this solely by using ethers.js as I don't want to bloat my ...
2
votes
1
answer
1k
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
1
answer
5k
views
What is that error called "code: -32000, message: 'header not found'" when I deploy smart contracts to BSC?
I am just stuck with this error as follow;
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code: -32000, message: 'header not found' })
I have no idea of any reason why I got this since I could see ...
0
votes
1
answer
963
views
Trying to withdraw from contract - Fail with error 'WARNING: not enough ETH for profitable frontrunning. Need at least 1 ETH at present market ...' [duplicate]
Tried to use a standard front running bot but the thing is my eth is still on the contract so I don't think I've been scammed (yet) makes no sense since my eth is still sitting there.
this is the code
...
23
votes
2
answers
11k
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?
21
votes
6
answers
33k
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 ...
17
votes
2
answers
14k
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 ...
14
votes
2
answers
1k
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 ...
13
votes
1
answer
3k
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 ...
13
votes
4
answers
3k
views
Deploying a contract from a multisig wallet
I created a multisig wallet using Mist, but don't know how to deploy a contract from the wallet address. Is it even possible? If so, how to do this?
13
votes
9
answers
33k
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)...
12
votes
3
answers
24k
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.
9
votes
3
answers
7k
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 ...
8
votes
1
answer
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 ...
7
votes
3
answers
6k
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 ...
6
votes
1
answer
3k
views
Initialize state variables in the contract constructor or directly in the declaration?
Is there any difference when initializing variables in the contract constructor or directly in the declaration? What is the best practice?
contract A {
uint public storage = 10000;
constructor(){...
5
votes
2
answers
2k
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 ...
5
votes
1
answer
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 ...
5
votes
5
answers
2k
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
1
answer
6k
views
Deploying contract using byteCode
In that example you can see, how to deploy a new contract having just ABI and ByteCode
(uses for copy and deploy contracts from mainnet to your testnet for example).
/****** Deploying new contract ...
5
votes
3
answers
944
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 ...