I'm designing a forwarder wallet contract, user will deposit ERC/BEP-20 tokens and i will collect them back to a central wallet by calling my contract's function which will simply make a transfer of tokens from the forwarder wallet to my central wallet.

I need to predict the gas needed to run the function, same function call in goerli takes different gas each time:

  1. 60'569 used by txn here
  2. 43'469 used by txn here
  3. 51'705 used by txn here

Same goes for the mainnet:

  1. 47'119 used by txn here
  2. 46'121 used by txn
  3. 63'209 used by txn here

I'm estimating the gasPrice based on last few blocks, but still stuck to estimate the gas for a simple transfer function.

Please advise


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.