Rules in the EIP

EIP-3529 removed the SELFDESTRUCT gas refund, reduced the refund for certain SSTORE clears, and capped the total at one fifth of the gas used before refunds. The refund is applied after transaction execution. Ethereum EIP 3529 ↗

A simple calculation

If execution uses 100,000 gas before refunds and the counter reaches 30,000, the cap is 20,000. This gives 80,000 gas after the refund. Eligibility depends on storage-slot changes under the applicable EVM rules.

Testing estimates

Separate the execution gas limit from net gas and the final fee. A later refund does not increase gas available inside a call. Test transactions that write a slot several times and reconcile the estimate with the execution receipt.