0

I have a certain function logic coded for fallback function. This logic also contains some delete operations of storage variables (delete storeVarX;) due to which there might be some gas being refunded. Now the problem this is creating is, when i check the gas used by the fallback function in ethscan, it shows as 29,349. But allocating 30,000 gas or even 50,000 gas units to execute this function raises an [Out of gas] exception.

is there a way I can estimate gas consumed by fallback function, excluding the gas refund due to delete operations?

  • How do you invoke the fallback function? If you invoke the function through a.transfer() or a a.send() the fallback function has only 2300 gas at disposal.. – Briomkez Mar 29 at 10:00
  • The contract expects an EOA (externally owned account) to send ethers to the contract directly and a specific gas units as gas limit. I need to calculate how much gas units are required (minimum gas limit) to successfully execute the fallback function. – Kombo Mar 29 at 11:14
  • Did you already tried with REMIX IDE as suggested here? ethereum.stackexchange.com/questions/50863/… – Briomkez Mar 29 at 11:18
  • the gas estimate is showing as infinite in remix IDE. I was hoping to try something like gasEstimate() function in web3. – Kombo Mar 29 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.