I deployed my smart contract to the ropsten testnet and everything worked fine. Now I wand to deploy it to the mainnet and I always get an error. How is that possible? What can I do?
Setup
- Truffle v4.0.4 (core: 4.0.4)
- Solidity v0.4.18 (solc-js)
- geth v1.7.3
Deployment
1. The Ethereum Node is up and running
geth --fast --cache=1048 --unlock "MyAddress" --rpc --rpcapi "eth,net,web3" --rpccorsdomain '*' --rpcaddr localhost --rpcport 8546
2. the truffle config
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// for more about customizing your Truffle configuration!
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
ropsten: {
network_id: 3,
host: "127.0.0.1",
port: 8545,
gas: 4700036
},
main: {
network_id: 1,
host: "127.0.0.1",
port: 8546,
gas: 4612388
}
},
rpc: {
host: '127.0.0.1',
post: 8545
}/*,
solc: { optimizer: { enabled: true, runs: 200 } }*/
};
3. The migration with truffle
truffle migrate --reset --compile-all --network main
4. the log
Using network 'main'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value
at Object.InvalidResponse (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:41484:16)
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:329530:36
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:176186:11
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:325200:9
at XMLHttpRequest.request.onreadystatechange (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:328229:7)
at XMLHttpRequestEventTarget.dispatchEvent (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176415:18)
at XMLHttpRequest._setReadyState (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176705:12)
at XMLHttpRequest._onHttpResponseEnd (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176860:12)
at IncomingMessage.<anonymous> (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176820:24)
at emitNone (events.js:91:20)
What I already checked
- Yes, the network is fully synced.
- Yes, I have enough ETH on my account.
UPDATE
When I set gas: 359077 the error is different:
Using network 'main'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x0296d1db2a914b4d09a37881a517c2cb6983867027fa058e3636cdd0e9b79526
Migrations: 0x73f823c7638cd1a7adc5e746432fc1f9b503d2c4
Saving successful migration to network...
... 0x66e08450f3b6fa43dc10b4e4d0a0fa57c57b7713bb4786ad9892769efbbb77f5
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying MyCrowdsale...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: intrinsic gas too low
at Object.InvalidResponse (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:41484:16)
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:329530:36
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:176186:11
at /opt/local/lib/node_modules/truffle/build/cli.bundled.js:325200:9
at XMLHttpRequest.request.onreadystatechange (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:328229:7)
at XMLHttpRequestEventTarget.dispatchEvent (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176415:18)
at XMLHttpRequest._setReadyState (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176705:12)
at XMLHttpRequest._onHttpResponseEnd (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176860:12)
at IncomingMessage.<anonymous> (/opt/local/lib/node_modules/truffle/build/cli.bundled.js:176820:24)
at emitNone (events.js:91:20)
eth.getBlock("latest").gasLimit) and still get the same error message. – Nina Jan 03 '18 at 13:24