0

I have deployed erc20 contact in Robsten network : https://ropsten.etherscan.io/token/0xa93d83709a1b35f67b30e7400b200690aa51859a?a=0x2c5253b9055cfd3ac7a2d352934fb5c45f667367

Code can be found here (from Mainnet): https://etherscan.io/address/0x6c94f6a21ef54b99c5985642814877210531d99b#code

Then tried to estimate amount of gas for the transfer method on Geth console :

> tranferdata = fouracoin.transfer.getData("0x2c5253b9055cfd3ac7a2d352934fb5c45f667367",15)
 "0xa9059cbb0000000000000000000000002c5253b9055cfd3ac7a2d352934fb5c45f667367000000000000000000000000000000000000000000000000000000000000000f"

> web3.eth.estimateGas({from : "0x0ba72bae6f69c4d20b5e1eed5f930b3def1595ae" , to : "0x2c5253b9055cfd3ac7a2d352934fb5c45f667367", data : tranferdata})
22872

> fouracoin.transfer("0x2c5253b9055cfd3ac7a2d352934fb5c45f667367",15)    
"0x69952895c550a12bfa4d0f874950b67d36952e6099ece2dbf3e09dabd84de401"

My estimated gas amount is 22872 while actual one 36325 : https://ropsten.etherscan.io/tx/0x69952895c550a12bfa4d0f874950b67d36952e6099ece2dbf3e09dabd84de401

1 Answer 1

0

This can happen based on the gasLimit you've considered and the gasPrice you've set. The gasPrice will be fixed but however the estimated gas and actual gas used differ.

This is why you set the gasLimit for at a minimum of 21000 for p2p transactions and 51000 minimum gasLimit for contracts. If you increase the gas limit though estimated gas is way below it, miners can still pick it up and work on the transaction based on the load which reflects the actual gas used to solve the particular transaction.

Your Answer

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

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