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,232 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
984 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
2,476 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
49,049 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
1,725 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
1,472 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,947 views
0 votes
1 answer

How to create a Genesis Block in a Private Network?

{     "nonce": "0x0000000000000042",     "difficulty": "0x000000100",     "alloc": {     },     "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",     "coinbase": "0x0000000000000000000000000000000000000000",     "timestamp": "0x00",     "parentHash": ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,740 points
2,030 views
0 votes
1 answer
0 votes
1 answer

How i can use nodejs to watch transactions in bitcoin network?

you can use  const Socket = require('blockchain.info/Socket'); const mySocket ...READ MORE

answered Jul 9, 2018 in Blockchain by digger
• 26,740 points
1,310 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP