Skip to main content
edited title
Link
Robbo
  • 201
  • 1
  • 6

Truffle givesexits with "Error: The contract code couldn't be stored, please check your gas amount." error when migrating the 1_initial_migration.js

Source Link
Robbo
  • 201
  • 1
  • 6

Truffle gives "Error: The contract code couldn't be stored, please check your gas amount." error when migrating the 1_initial_migration.js

I am trying to migrate the basic truffle example (the one created via truffle init) to rospten using Parity but I get the following error even thought the contract is correctly deployed on Rospten:

Using network 'development'.

Running migration: 1_initial_migration.js Deploying Migrations...
... 0x3f8cd1b1e98935feb4616e810f4ce0d6ebfbd7355ea8a8e9695a490173d8446e

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/lib/node_modules/truffle/buil/cli.bundled.js:218485:46)

at /usr/lib/node_modules/truffle/build/cli.bundled.js:34886:25
at /usr/lib/node_modules/truffle/build/cli.bundled.js:220423:9
at /usr/lib/node_modules/truffle/build/cli.bundled.js:72910:11
at /usr/lib/node_modules/truffle/build/cli.bundled.js:204149:9
at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:205574:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:73069:18)
at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:73359:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:73514:12)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:73474:24)

As you can see from here the contract is correctly deployed: https://ropsten.etherscan.io/tx/0x3f8cd1b1e98935feb4616e810f4ce0d6ebfbd7355ea8a8e9695a490173d8446e

This is the code for 1_initial_migrations.js:

var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations, {from: "0x004995b1caD48E77e7A53e535Bb82c8189B80632", gas:2000000});
};