opensea-creatures icon indicating copy to clipboard operation
opensea-creatures copied to clipboard

Insufficient funds but my wallet has enough balance.

Open shoguniphicus opened this issue 5 years ago • 8 comments

Any kind soul to point me in the right direction? I remember running into this type of error before, but even in the error log, I can see I have enough balance. Below are part of the logs that I have got when I tried to deploy the contract to Rinkeby network.

Summary

Total deployments: 2 Final cost: 0.004312506 ETH

1_initial_migrations.js

Deploying 'Migrations'

Error: *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds

  • Account: 0x1cce60f9Abe261C6F682CfE8738fb99568514d31
  • Balance: 28912154977541513 wei
  • Message: insufficient funds for gas * price + value

shoguniphicus avatar Nov 01 '21 09:11 shoguniphicus

Another thing to note is that the only thing I changed is the address and mnemonic, and infura key. Nothing else. so I am quite bummed to see this.

shoguniphicus avatar Nov 01 '21 09:11 shoguniphicus

@shoguniphicus have you find any fixes, i am having the same issue

nimamoradi avatar Nov 23 '21 22:11 nimamoradi

I faced this issue and then i re-deployed the contract on Rinkeby after 2 hours and this solved the issue. So seems like it was an intermittent issue.

If this doesn not solve the issue can you share 'truffle.js' and 'package.json'

humanwhoexplores avatar Jan 03 '22 11:01 humanwhoexplores

@humanwhoexplores same issue here, trying for over 2 days in a row. The funny thing is that the simulation (dry run) passes through but the rest does not. same error.

jimenofonseca avatar Jan 08 '22 10:01 jimenofonseca

@jimenofonseca Hey can you please share your 'truffle.js' and 'package.json'

humanwhoexplores avatar Jan 08 '22 12:01 humanwhoexplores

Hey I think I solved the issue. I just tuned the gas parameters

for deploying contracts in 2_deploy_contracts.js reduced to 2000000 for gas in rinkbey network in truffle.js reduced to 2000000

It worked! what do you think?

On 8 Jan 2022, at 1:02 PM, krishan chopra @.***> wrote:

@jimenofonseca https://github.com/jimenofonseca Hey can you please share your 'truffle.js' and 'package.json'

— Reply to this email directly, view it on GitHub https://github.com/ProjectOpenSea/opensea-creatures/issues/150#issuecomment-1007970518, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEOXAXGCOCPL5T64EHHIP3UVART3ANCNFSM5HDTPQWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.

jimenofonseca avatar Jan 08 '22 12:01 jimenofonseca

@jimenofonseca Hello , I faced this issue again today , let me share an example to explain this

Summary

Total deployments: 1 Final cost: 0.003550094 ETH

Error: err: insufficient funds for gas * price + value: address have 69845043488317125 want 100000000000000000 (supplied gas 5000005)

At this moment :- my wallet had 0.0698 ETH : which is Wei is 69845043488317125

Question :- if Final_Cost(0.003550094 ETH) < Wallet Balance: then why do i get the insufficient funds error

The reason is in truffle.js and 2_deploy_contracts.js
https://github.com/ProjectOpenSea/opensea-creatures/blob/master/truffle.js#L37 https://github.com/ProjectOpenSea/opensea-creatures/blob/master/migrations/2_deploy_contracts.js#L35

the Gas configured is 5000000 . This is the Gas limit (the max gas that can be used) From the docs :- the price per unit of the gas is 20 gwei https://trufflesuite.com/docs/truffle/reference/configuration.html 5000000 * 20 gwei = 100000000000000000 wei

Even though the gas required is less than the limit, it errors out because the eth in my wallet is less than the gas limit 100000000000000000 wei .

Hence, when we decrease the gaslimit in above hyperlinked lines the deployment is successful

humanwhoexplores avatar Jan 15 '22 15:01 humanwhoexplores

Thanks @humanwhoexplores, the devil was in the details. It's just not that obvious.

shoguniphicus avatar Jan 19 '22 23:01 shoguniphicus