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.

benjaminion
  • 9,247
  • 1
  • 23
  • 36
HARESH
  • 73
  • 6

0 Answers0