"Migrations" -- insufficient funds for gas * price + value

In part 2 of Solidity 201 I get the error

“Migrations” – insufficient funds for gas * price + value.

at C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Migration._deploy (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:74:1)
at Migration._load (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:61:1)
at Migration.run (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:212:1)
at Object.runMigrations (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.run (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:87:1)
at runMigrations (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:263:1)
at Object.run (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:228:1)
at Command.run (C:\Users\anton\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:136:1)

Truffle v5.2.4 (core: 5.2.4)
Node v14.16.0

when I try to deploy on ropsten.

truffle-config.js:

ropsten: {
provider: () => new HDWalletProvider(mnemonic, https://ropsten.infura.io/v3/483ac8cf0f614391b7fa1bbea68fe51b),
network_id: 3, // Ropsten’s id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
}

When I set the gas higher I get

“Migrations” – exceeds block gas limit.

instead.

Can anybody help me with this problem?

1 Like

Please share your repo or st least full migration files.

Hi Thomas,

Thank you for your help!
I uploaded the code here:

https://github.com/darntz/CoinFlip

Daniel

1 Like

You are welcome :slight_smile:
From first glimpse, everything looks good. Did you read this post?

I assume you do have enough TestETH in your ropsten account? In case you are looking for a Ropsten Faucet click here

I had read a similar posts, however chenging the gas value in truffle-config does not help. Sometimes, however, after changing the gas value, I get another error instead: “Migrations” – exceeds block gas limit.

I had 1 ETH on the account, Now I added more and have 6. But it is still not working, unfortunately.

1 Like

Is your migration working with a local testchain like truffle develop?

Yes, the local truffle migration was working.