4

web3.eth.estimateGas is always calculating low gas for the transaction. Here is a reference to a trasaction in ropsten. https://ropsten.etherscan.io/tx/0xd5bead5b576b2f4e4cbe83e4acf20d701740b05fdaf3f2749e0c1973ea4c7d6c

I used the data feild and contract address to calculate the gas. I got => 21464. But it actaully required 47032. This is one example but I have the same problem for other transactions as well.

web3.eth.estimateGas({ to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003" }) .then(console.log);

1

1 Answer 1

0

yes.but not always lower, we just can say it's not accurate, due to the time flying and the ETH network change every second.

This estimation is based on the right now state of the network when you check.

However, the actual gas required for a transaction is depending on a number of factors such as the complexity of the transaction and the current state of the network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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