I have a doubt about the gas refund concept.

Imagine that I created a smart contract 1 month ago and now I want to call the SELFDESTRUCT because I want to send the current balance to an address and stop using that smart contract. So far I understood that the gas refund will be deducted from the total gas cost of the transaction that is calling the SELFDESTRUCT, am I right? If not, how is the gas refund "payed"?


I was trying to find a proper reference to this in Solidity docs, but for some reason I couldn't. The only proper thing I found was https://docs.soliditylang.org/en/develop/introduction-to-smart-contracts.html?highlight=selfdestruct#deactivate-and-self-destruct which doesn't say much about refunds.

So, you are correct. The refund is given in the same transaction, and it can't be stored. Also, the refund can never lower the transaction gas usage to under the basic cost of 21000. This is correct for any refund.

  • Thanks for the answer, I had problems looking for this on the docs too Jan 31 at 13:39

Your Answer

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

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