EatTheBlocks Forum

Profitable-flashloan - Issue with Gas Limit and Gas Price

Enjoying the course and near the end. Trying to deploy to mainnet but I simply can’t get past the final ‘truffle migrate --network mainnet --reset’. It consistently runs out of gas. I was getting issues where it would show insufficient funds with the code structured the way it’s shown in the training. But then I added the following under ‘mainnet’ in truffle-config.js and I’m not getting that error any more…

mainnet: {
provider: () => new HDWalletProvider(
process.env.PRIVATE_KEY,
process.env.INFURA_URL
),
network_id: 1,
gas: 100000000,
gasPrice: 150,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true
},

Now my errors look like this…

Error: Deployment Failed

“Migrations” ran out of gas (using a value you set in your network config or deployment parameters.)

  • Block limit: 30029295 (0x1ca35ef)
  • Gas sent: 30000000 (0x1c9c380)

No matter what I put in the gas and gasPrice I get this error. I’ve got 0.009754 ETH (~$40). The training video says I only need $20-30. Has the cost of deploying for the initial transaction gone up that much since the training video was made? Or, are my gas limit and gas price wrong? I know this is a bidding process for mining but there is too much guessing involved. I just want my code to be accepted and deployed. What do I do?

I now have $100 worth of ETH in my account and still getting the same problem. Can anybody help?

Sorry for the long delay in getting back to you. So this has been an issue with ethereum as after the new update eip1559 the gas rates have been considerably higher. The new system has a base fee and a tip to make them go through faster. Well the fees now are about 6 times what they were when julien made this video. Since that has happened, I myself under juliens assignment made a Binance Smart Chain version that is very similar and Much cheaper to deploy. It should be updated in next few days to main repo.

Thanks! Looking forward to dining in to that