What the issue is, in broad strokes.
Error encountered, bailing. Network state unknown.
Running migration: 2_deploy_contracts.js
Deploying NEXTTokenCrowdsale...
... 0x3b22b5c2795c0a9f53a5295cca84af1ddcaafd363120738fa126af8be0b256fa
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
at Object.callback (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:329221:46)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:39618:25
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:331159:9
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:175492:11
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:314196:9
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:315621:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70159:18)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70449:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:70604:12)
at IncomingMessage.
Please provide the shortest amount of steps to reproduce your issue.
With every contract deployment on Ropsten or private blockchain we get this error after running the command:
truffle deploy --network='ropsten' --reset
Yesterday everything worked!
What you expected to happen.
No deployments of contracts possible.
What actually happened. Please give examples and support it with screenshots, copied output or error messages.
The problem is likely that the optimizer is now disabled by default in Truffle 4, and I believe Ropsten's block gas limit may be too low.
You can find background on why we disabled the optimizer in trufflesuite/truffle-compile#5, and instructions for re-enabling it in the docs. Let me know if you try that and if it works. Thanks!
I enabled the optimizer according your the description in the docs. Here is my truffle.js file:
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*"
}
},
rpc: {
host: "localhost",
gas: 4712388,
port: 8545
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
};
If I run:
$ truffle migrate --reset
I get the following error:
Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Error: Exceeds block gas limit
.
.
.
$ truffle version
Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)
Do you have any idea what is going wrong there?
I'm getting the same errors after updating to latest truffle and testrpc. If I set a gas param in truffle.js I get


This never happened before updating. Nothing's changed in my contracts. Only updated truffle and testrpc. On the other hand if I run truffle develop and then migrate everything works fine.
Updating also affected deploy to rinkeby where I get out of gas error.
I got the same problem as @Bowfish
From this issue, you may need to split up your contracts into smaller contracts so they get easily deployed with a gas amount that is within the block limit, as enabling solc optimizer may not be exactly what you want to do [you may begin to have bytecodes that behave differently from your source code].
Visit the truffle release page to see security concerns associated with enabling solc optimizer.
Hope this helps.
Unfortunately this doesn't help. I tested it with the default Metacoin.sol contract which is created with truffle init. Therefore the bug must be somewhere else.
Oh! Then the bug must be somewhere else for sure. I'll keep checking for a working solution and inform here if possible.
There's an issue with this version of truffle for sure. Did a clean ubuntu install with latest node, truffle, testrpc and I get out of gas in any situation. So having optimization flag enabled in truffle.js does not help. I've used for this test some really simple contracts. For example https://github.com/LindaHealthcareICO/linda-crowdsale used to work with previous truffle version. Please note if you test those contracts there's a typo in their package.json file (a trailing coma in the scripts section) so you should fix that before installing.
I installed truffle 4.0.0-beta.0 and everything is working fine.
Worked for me too. Downgrading fixed the issue!
Hi everyone. Thanks for the feedback.
Are you all using the TestRPC? If so, try using truffle develop instead, and let us know if the issues disappear. Please refer to the 4.0 release notes for more information about truffle develop.
@tcoulter Hi, yes, I'm on testrpc. As previously mentioned truffle develop works fine but I've chosen testrpc because I couldn't get the created accounts private keys nor set a custom balance for each account.
Thanks!
I'm on testrpc too.
I tested it on truffle develop and everything is working fine. This is much more convenient than testrpc. Great job!
Is it possible to create more than 10 accounts in truffle develop in the same way as with testrpc --accounts 20 ?
It seems that gas and gasPrice from truffle.js are not getting passed to TestRPC anymore, though I don't know how and when exactly they were passed earlier. Starting TestRPC with --gasLimit 6721975 --gasPrice 100000000000 (to mimic the hardcoded default values in truffle-core) made our tests work again.
Just to reinforce the thread, I was facing the same issue. Downgrading truffle to 4.0.0-beta.0 fixed the issue.
Ubuntu 16.04
sudo npm uninstall -g truffle
sudo npm install -g truffle@beta
truffle deploy
Error encountered, bailing. Network state unknown.
I had the same error, but with truffle develop it works perfect. You can use truffle develop instead of testrpc. With truffle develop you have the same functionality as with testrpc but with some additional cool features.
What about migrating to a remote test network. Are you sure the issue won't be there? Truffle develop works for me too but when I try to migrate the code to rinkeby I get the same out of gas error.
Same problem, I solve it by forcing --gasLimit to a high value "9999999999"
Same error on Ubuntu with Truffle 4.0.1, using testrpc
setting gas limit does not help.
downgrading to @beta works fine.
Having the same issue, downgrading did'nt help. Everything works on local TestRpc, but if I try to publish it to Ropsten or Rinkeby via Geth it wont work.
Ubuntu 16.04
Truffle v4.0.0-beta.0
Geth 1.7.2-stable-1db4ecdc
I second sorccu, used testrpc -p 8546 --gasLimit 6721975 --gasPrice 100000000000 and contract migrations worked with [email protected]
Had the same issue with truffle 4.0.1 and testrpc and had to set gas limit and price as advised. Just updated testrpc to latest version (EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2)) and it works for me without setting gas. Haven't tried deploying on test networks yet. If it still doesn't work on those, does anyone in truffle support have an idea when it will be fixed please?
same issue:I use truffle+infura
ubuntu 16.04
truffle V3.4.9
Same issue:
Mac OSx High Sierra
truffle V4.0.1
testrpc
Everything works using the solution provided by sorccu
Same issue:
Mac OSx High Sierra
truffle V4.0.4
ganache-cli: V6.0.3
Sorccu's suggestion above also resolved this issue for me
Try adding the max gas while deploying in 2_deploy_contracts.js
deployer.deploy(Con1, {gas: 6721975, from: "0xaddr"});
To get gaslimit 6721975, I used web3.eth.getBlock("pending").gasLimit. This is working for me in ubuntu , truffle4.0.0
Rewrite your truffle.js file like
module.exports = {
networks: {
development: {
host: "10.0.0.18",
port: 8545,
gas: 6712388,
gasPrice: 65000000000,
network_id: "*" // Match any network id
}
}
};
Had the issue with the newest version of Ganache, set this in truffle.js
gas: 6712388,
gasPrice: 65000000000,
Everything is working smoothly.
I have the same issue. I am able to migrate contract successfully, but i cannot use truffle test.
truffle version
Truffle v4.0.5 (core: 4.0.5)
Solidity v0.4.18 (solc-js)
This is my truffle.js
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*", // Match any network id
gas: 4712388,
gasPrice: 65000000000
}
}
};
I am using a private chain I created myself, genesis.json is shown below:
{
"config": {
"chainId": 1994,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158lock": 0,
"byzantiumBlock": 0
},
"difficulty": "40",
"gasLimit": "2000000",
"alloc": {
"d096c53d11fd0ae326a6784f2c2e8e4d12b1fc4e":{
"balance": "1000000000000000000"
},
"c40d5622f4a50b0028ef134e78853e006e481ad3":{
"balance": "0"
}
}
}
ubuntu 16.0.4
Issue solved by re-enable the optimizer from Truffle Documentation.
This is my truffle.js
var HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "5777"
},
rinkeby: {
provider: function() {
return new HDWalletProvider("my own mnemonic", "https://rinkeby.infura.io/xxxxx")
},
network_id: 3
}
}
};
I'm unable to migrate to a remote network like Rinkeby keep getting error: insufficient funds for gas * price + value
@camelscript did you find the solution? I'm facing that problem too. I can deploy to testrpc successfully, but I cannot deploy to rinkeby. The truffle migrate outputs:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
Strangely it's working today. I'm using Truffle version v4.0.5 and migrating a small contract. Here are my settings in truffle.js
ropsten: {
provider: new HDWalletProvider(
mnemonic,
'https://ropsten.infura.io/XAmfM8SVSh5OkuiYMIBx',
2
),
network_id: 3,
gas: 4600000,
},
rinkeby: {
provider: new HDWalletProvider(
mnemonic,
'https://rinkeby.infura.io/XAmfM8SVSh5OkuiYMIBx',
2
),
network_id: 4,
gas: 6712388,
gasPrice: 1000000000
}
@yisheng thank you. It works by enabling optimizer. Do you know why?
Same error with gas and optimizer activated :
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
Truffle v4.0.5 (core: 4.0.5)
Solidity v0.4.18 (solc-js)
truffle.js config :
```
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
networks: {
ropsten: {
provider: function() {
return new HDWalletProvider(mnemonic_ropsten, "https://ropsten.infura.io/XXX")
},
gas: 4600000,
network_id: 3
}
}
};
@erickhun How about removing gas: 4600000?
@yisheng it didn't work :/
After several tries, setting gas: 4698712 worked :
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
networks: {
ropsten: {
provider: function() {
return new HDWalletProvider(mnemonic_ropsten, "https://ropsten.infura.io/XXX")
},
gas: 4698712,
network_id: 3
}
}
};
How does your migration file look like?
truffle deploy --network live is failing for me with:
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*", // Match any network id
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
gas: 5000
},
live: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e"
},
kovan: {
network_id: 42,
host: "127.0.0.1",
port: 8545,
from: "0x33dbe8478805cf734184aeD8737607656252D804",
gas: 5000000
}
}
};
Ok, but what about the file that deploys the actual contracts? (e.g. 2_deploy_contracts.js) I got the error "The contract code couldn't be stored, please check your gas amount" when this file was not correct.
I ran into the same issue with truffle 4.1.0 using ganache.
I tried adding rpc and solc options to truffle.js => no improvement.
I downgraded to 4.0.7 => no improvement
I downgraded to 4.0.5 (npm i -g [email protected]) => problem solved.
4.0.6 fails as well.
@chevdor Apologies, could you provide any additional context or information - for example your truffle.js? Is the project you're working on public?
There was quite a bit added in the 4.0.6 release - if you've managed to isolate that as a source of problems it would be nice to resolve them.
I updated geth & truffle today.
Now I'm getting "Transaction not found after 50 blocks" when trying to deploy to mainnet.
I tried setting my gas higher than anything on http://ethgasstation.info/ , still with no publication of the contract.
truffle.js:
live: { host: "127.0.0.1", port: 8545, network_id: "*", from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e", gasPrice: 9, gas: 200000 },
(I also tried with gasPrice: 1, 2 and 3)
and here's the log from truffle migrate --network=live --verbose-rpc
"jsonrpc": "2.0",
"id": 5, "method": "eth_sendTransaction", "params": [ { "from": "0xa281cd2ba15dc43f8110ddaee837274800931f7e", "gas": "0x30d40", "gasPrice": "0x204876e800", "data": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a72305820d665cc9568c7a7748b83ea660894eb49b5ca37bea613615823cc9fdd35ac51260029" } ] }
eth.getBalance(eth.accounts[1])
100000000000000000
which is plenty more than gas * gasPrice.
/geth version
Geth
Version: 1.8.2-stable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10
Operating System: darwin
GOPATH=/Users/quantum/code/go
GOROOT=/usr/local/Cellar/go/1.10/libexec
~/truffle version
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
and to the end..
> "jsonrpc": "2.0",
> "id": 1568,
> "method": "eth_uninstallFilter",
> "params": [
> "0xbe6517333d9e36227699e900b12523bc"
> ]
> }
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:112:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:128:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:127:1
at Array.forEach (<anonymous>)
at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:125:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:259:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:258:10
at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
@quantumproducer the gasPrice in your truffle.js is in units of wei, so setting a gas price of "9" is basically like not providing any gas. probably you meant 9 gwei which i think is 9000000000
Ah I read ina blog post that gas was done in GWei, I see now that's just how it's referred to but the vlaues are in wei.
@habdelra I tried with 7000000000 Same result.
https://ethgasstation.info/ says gas price is 3 Gwei
I have the same problem. And none of the solutions helps.
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.

@mradkov edit, nvm re: gas
@quantumproducer The strange thing is the contract is working just fine when published by web3 or in remix. (Tested on Ropsten).
I'm still getting this issue on mainnet. Btw Mradkov how did you calculate the gas usage exactly for your contract deployment? (Something in truffle?)
I'm having a similar issue, though specifically with mainnet:
I'm trying to only deploy the Migrations.sol
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
},
rinkeby: {
host: "localhost",
port: 8545,
network_id: "4",
from: '...',
gas: 4500000,
gasPrice: 21000000000
},
mainnet: {
network_id: 1,
from: '...',
host: "localhost",
port: 8546 // Different than the default
}
}
}
I've tried lots of combinations of gas and gasPrice. Very confusing.
truffle migrate --network mainnet -f 1 --reset
Using network 'mainnet'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: exceeds block gas limit
geth version 1.8.2
truffle version 4.1.0 and 4.1.3
It works swimmingly on rinkeby and testrpc.
Any suggestions?
@mradkov I'm able to deploy to kovan fine. I need to deploy to the main net.
Remix gives me the error: https://github.com/ethereum/remix/issues/716
BTW, my issue here wound up being that my node was not fully synced. I should probably create a new issue, "When trying to deploy to a node that is not fully synced, an error about gas limit is given, rather than something that makes sense"
Agreed, the same error confused me to. It wasn't clear from the error that you had to sync to deploy.
I get this error now, after syncing.
Here's my truffle migrate --network=live --verbose-rpc log:
> "jsonrpc": "2.0",
> "id": 5,
> "method": "eth_sendTransaction",
> "params": [
> {
> "from": "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
> "gas": "0x3d0900",
> "gasPrice": "0x218711a00",
> "data": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a72305820d665cc9568c7a7748b83ea660894eb49b5ca37bea613615823cc9fdd35ac51260029"
> }
> ]
> }
< {
< "jsonrpc": "2.0",
< "id": 5,
< "result": "0x4afc5333a0c12c03b5d0866e819a909ed5fa37f94d583824f14d4d97f8ec0272"
< }
... 0x4afc5333a0c12c03b5d0866e819a909ed5fa37f94d583824f14d4d97f8ec0272
> {
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 2000
}
},
// See <http://truffleframework.com/docs/advanced/configuration>
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*", // Match any network id
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
gas: 5000
},
live: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
gasPrice: 9000000000,
gas: 4000000
},
kovan: {
network_id: 42,
host: "127.0.0.1",
port: 8545,
from: "0x33dbe8478805cf734184aeD8737607656252D804",
gas: 5000000
}
}
};
"Contract couldn't be found after 50 blocks"
Why? I'm offering 9 GWEI for gas. Why does this happen?
I've tried without the optimizer, too. geth is 1.8.2
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
I'm unable to deploy my smart contract while this is happening.
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:112:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:128:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:127:1
at Array.forEach (<anonymous>)
at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:125:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:259:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:258:10
at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
I am experiencing the same issue...
Truffle v4.1.3 (core: 4.1.3)
Solidity v0.4.19 (solc-js)
The contract deploys just fine to Ganache development network.
The contract fails to upload to Ropsten test network.
My truffle.js source:
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
ropsten: {
host: "127.0.0.1",
port: 8545,
network_id: 3,
gas: 4698712,
//gasPrice: 100000000000,
from: "0x689bb9068f12BfaCEF6aeeC6f37d9fa5963d4bd7" //<your unlocked ropsten account address>
},
},
};
Following up from my post yesterday... was able to deploy successfully using the GAS Limit specified in Ropsten Etherscan.
How I did it...

ropsten: {
host: "127.0.0.1",
port: 8545,
network_id: 3,
gas: 1828127, // <- new GAS LIMIT value
//gasPrice: 100000000000,
from: "0x689bb9068f12BfaCEF6aeeC6f37d9fa5963d4bd7" //<your unlocked ropsten account address>
},
output:
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x3f70c4a4a5edb7e36d6912029f25e03b2d0d89272fa4e8d18245c2994ef73eb5
Migrations: 0xfbd7c346839fe9715bedb9003a01986802f229f0
Saving successful migration to network...
... 0xc2a0c7670c91f45a7c498fbc9595fde62c8b6f61e060eb4c12e443af73eb118e
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying Adoption...
... 0x380c2e0761120168f2031f869d6aa7bf48e3c3affeb8f41fea9798403aa3555f
Adoption: 0x9b91cf236739a0c2e61c08c0ee481224b9c02cdd
Saving successful migration to network...
... 0x539c94a23026196c18cf6c31848fc8a8c2273c1c8787165f89ddec263da20051
Saving artifacts...
='s Success :)
What worked for me is:
truffle migrate --clean --network ropsten
Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.
There has been no new activity on this issue since it was marked as stale 7 days ago, so it is being automatically closed. If you'd like help with this or a different problem, please open a new issue. Thanks!
Error 'The contract code couldn't be stored, please check your gas amount.'
As I just learned - if you get this error while deploing to private network - it could signal, that remote node have wrong evm version
Also truffle could try to compile and deploy contracts for petersburg at byzantine network and give only
Error 'The contract code couldn't be stored, please check your gas amount.
You can check difference your local ganache evm version and version of other chain you want to deploy to
Most helpful comment
It seems that
gasandgasPricefromtruffle.jsare not getting passed to TestRPC anymore, though I don't know how and when exactly they were passed earlier. Starting TestRPC with--gasLimit 6721975 --gasPrice 100000000000(to mimic the hardcoded default values in truffle-core) made our tests work again.