3

I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and github issues but all are failed. I tried by increasing gas limit(800000) in truffle.js also but it didn't work.

Full error message -

(node:14587) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: The contract code couldn't be stored, please check your gas amount.
(node:14587) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment:
Node v8.0.1
Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)
EthereumJS TestRPC v4.1.3 (ganache-core: 1.1.3)

Can anybody suggest me possible solution of that? Thanks in Advance.

  • The value you use 800k is a bit low for a moderate contract, try increasing the gas to 4M, another posibility is some require or assert in your constructor is failing and causes and out of gas exception. – Ismael Dec 13 '17 at 5:30
  • Now i am using the gas 6.7M , but still it not get worked and their is no asset and require in the constructor – Satyam Agrawal Dec 13 '17 at 6:14
  • Without the code it is impossible to check what can be wrong. If the constructor doesn't have assert ore requires check the parent classes, also modifiers, if you are on testrpc try very large amount of gas like 100M. Some times truffle get confused with corrupted artifacts, if you are on testrpc try deleting the build/ directory and doing a truffle migrate --reset. – Ismael Dec 13 '17 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.