Insufficient funds for gas * price + value

I’m receiving this error when approving a transaction on Ethereum Mainnet, even though I have enough balance:
insufficient funds for gas * price + value: balance 10459790858839717, tx cost 14285714285700000, overshot 3825923426860283

@web3auth/base”: “^8.8.0”,
@web3auth/coinbase-adapter”: “^8.9.1”,
@web3auth/ethereum-provider”: “^8.10.2”,
@web3auth/metamask-adapter”: “^8.8.0”,
@web3auth/no-modal”: “^8.10.2”,
@web3auth/openlogin-adapter”: “^8.8.0”,
@web3auth/wallet-connect-v2-adapter”: “^8.6.2”,
“web3”: “^4.11.0”,

Does anyone have any idea? It does work on Ethereum Testnet, and Arbitrum One

The error is from RPC, you account has a balance of 0.0104, and the gas it requires to execute the transaction is 0.014, hence it’s giving the error. Usually in production, you should calculate the gas upfront, and show error upfront of insufficient which doesn’t allow to submit transaction.

Hey thanks for explaining that. Do you know a good way to calculate the gas?

It’s same as the error message, gas + price + value, where gas is gasLimit, price is gasPrice, and value is native token value. If no native token is involved it’s 0, for instance if you are swapping, sending, etc 0.001 ETH from A to B, in that case value would be 0.001, and for other cases it’s zero.However after new Ethereum upgrade, the price can be (base + priority fee). You can read more here.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.