1

I keep getting the error please check your gas amount or exceed gas limit.

The truffle config file

module.exports = {
    networks: {
        development: {
            host: 'localhost',
            port: 8545,
            network_id: '*', // Match any network id,
            gas: 4712388,
            gasPrice: 65000000000,
        },
        solc: {
            optimizer: {
                enabled: true,
                runs: 200,
            },
        },
    },
};

Error displaying on console while migrating - truffle migrate and I am running in ganache-cli client and even truffle develop throws the same error

Using network 'development'.

Running migration: 1_initial_migration.js
  Replacing Migrations...
  ... 0x3d291bb6431ee53a9fa794b750c39cd08939a4136b69f228287b26326f261990
  Migrations: 0xa936288081412d5f6dbfbb7e8c15526c3a51b47b
Saving successful migration to network...
  ... 0x124e61a2327c00a9cc478c81f169fdd2568bf38eeb5dba4deb8677ddbf324744
Saving artifacts...
Running migration: 2_application_migration.js
  Deploying Applications...
  ... 0x40e181355f93e1b0fb6e99137d5a87160b5c6b22061b9703718708918d6d8184
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 (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:147:1)
    at /Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/method.js:142:1
    at /Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:89:1
    at /Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
    at /Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage.<anonymous> (/Users/ajainvivek/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Can someone please help here. Its terribly annoying.

1

The issue was with setting constructor to be internal, I had to change it to public

function Applications() public {  // changed from internal to public
    applicant = msg.sender;
  } 

unfortunately, the error was misleading in console

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.