How to solve network state unknown Review successful transactions manually error

0 votes

I am trying to deploy a smart contract from truffle

truffle.js:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      gas: 4700000, 
      from: '0x24182550B8630629501AC11f5568dbb7EE18dBd2',
      network_id: "*" // Match any network id
    },
  }
};

But when try to deploy it, I get the following error:

Running migration: 2_deploy_contracts.js
  Deploying SuperHeroTokenThreeCrowdsale...
  ... 0x9d0da17f00192993720639abceecc2b33c5fbb9a29dd43fa6e1abd0ce6aecc5d
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:314870:46)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:35060:25
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:316808:9
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:164746:11
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:294942:9
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:296367:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:164934:18)
    at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:165224:12)
    at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:165379:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:165339:24)

Jul 27, 2018 in Blockchain by slayer
• 29,370 points
1,790 views

1 answer to this question.

0 votes

There seems to be error in the code. Change the code as follows:

const IcoMyCoin = artifacts.require("./MyCoinCrowdsale.sol");
const duration = {
    seconds: function(val) { return val},
    minutes: function(val) { return val * this.seconds(60) },
    hours:   function(val) { return val * this.minutes(60) },
    days:    function(val) { return val * this.hours(24) },
    weeks:   function(val) { return val * this.days(7) },
    years:   function(val) { return val * this.days(365)}
};
module.exports = function(deployer, network, accounts) {
    const startTime = web3.eth.getBlock('latest').timestamp + duration.minutes(1);
    const endTime = startTime + duration.minutes(30);
    const rate = new web3.BigNumber(1000);
    const wallet = '<< YOUR WALLET ADDRESS>>';
    deployer.deploy(IcoMyCoin, startTime, endTime, rate, wallet)
};

Now you should be able to deploy it without any problem.

answered Jul 27, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

How to solve Runtime error when querying Hyperledger?

OCI is open container initiative.. The error ...READ MORE

answered Jul 9, 2018 in Blockchain by slayer
• 29,370 points
1,642 views
0 votes
1 answer

How to solve EACCES:permission denied error in Hyperledger Composer?

It seems like there is no required ...READ MORE

answered Jul 11, 2018 in Blockchain by digger
• 26,740 points
3,193 views
0 votes
10 answers

How to solve gradle build failed error?

I migrated the project to a different ...READ MORE

answered Dec 7, 2018 in Blockchain by Rajat
52,249 views
0 votes
1 answer

How to solve "Failed to deserialize creator identity error"?

It seems like the problem is caused ...READ MORE

answered Jul 13, 2018 in Blockchain by slayer
• 29,370 points
2,281 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
3,255 views