3

I am trying to deploy multiple dependent contracts with truffle on testrpc.

For example,Migration script are as follow:

deployer.deploy(a,10000).then(function(instance){
   owner = web3.eth.accounts[0];
   _a = instance;
   return deployer.deploy(b,_a.address)
}).then(function(){
  return b.deployed();
}).then(function(instance){
   _b = instance;
   gasEstimate = 2000000;
   return deployer.deploy(c, _b.address, {from: owner, gas: 
          gasEstimate+40000});
}).then(function(){
   c.deployed();
}).then(function(instance){
   _c = instance;
   return _b.setUpgrade(_c.address);
});

While migrate gives error as,

The contract code couldn't be stored, please check your gas amount.
    at Object.callback (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:207913:46)
    at C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:31866:25
    at C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:209746:9
    at XMLHttpRequest.request.onreadystatechange (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:208522:13)
    at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:210395:18)
    at XMLHttpRequest._setReadyState (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:210685:12)
    at XMLHttpRequest._onHttpResponseEnd (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:210840:12)
    at IncomingMessage.<anonymous> (C:\Users\as\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:210800:24)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)

Is there any suggestion? Thanks in advance.

  • Have you tried increasing the gas – Joe Jul 28 '17 at 12:26
  • Yes,I tried by increasing gas from 2000000 to 4000000 – HARESH Jul 28 '17 at 12:38
  • Recently I read that abstract contract can not deploy and I am trying to deploy abstract contract.This is the reason for error.Thanks – HARESH Jul 31 '17 at 7:24

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.