Part III · Chapter 23 of 43 · London

EIP-3529: killing the gas-refund loophole

Freeing storage used to hand you a big gas refund — a nice idea that got gamed. Contracts hoarded refunds as 'gas tokens,' and refunds let a block do nearly twice the real work its gas limit implied. EIP-3529 doesn't abolish refunds; it shrinks them and caps them, so cleaning up state still pays a little but the exploit dies — and blocks stay predictable for the new fee market.

Updated Jun 24, 2026 · 9 min
Assumed
  • gas & storage (SSTORE)
  • the EIP-1559 fee market

London, August 2021. The famous change that day was EIP-1559, but it shipped with a quieter companion that made 1559 actually work. Ethereum had long offered a gas refund for freeing storage: set a slot back to zero, or SELFDESTRUCT a contract, and you got gas back. The intent was benign — reward people for shrinking the state everyone stores. But a refund is money, and money invites gaming. By 2021 the refund had become a small industry and a real headache for block accounting. EIP-3529 is the fix, and it’s a nice case of adjusting an incentive rather than deleting it. Let’s derive it.

1 step Refunds got gamed

The problem: refunds became a tradeable asset

Clearing a storage slot refunded up to ~15000 gas; SELFDESTRUCT refunded 24000. That created a perverse trade. When gas is cheap, a contract can SSTORE a pile of slots to non-zero; later, when gas is expensive, it clears them and collects the refunds — effectively buying gas at the low price and spending it at the high price. These contracts were gas token A contract (e.g. GST2, CHI) that hoards gas by writing storage slots when gas is cheap and clearing them for a refund when gas is dear — storing value in otherwise-useless state to arbitrage the gas price. , and they did nothing useful except bloat the state and arbitrage the fee market.

refunds were gamed: buy gas cheap, spend it dear gas cheap → mint SSTORE many slots gas dear → harvest clear → big refund worse: refunds let a block do up to 2× the gas limit of real work a 'gas token' — value stored in useless state, gaming the gas price
Fill storage slots while gas is cheap, then clear them when gas is dear to harvest the refunds — 'gas tokens' stored value in useless state to game the gas price. Worse, because refunds offset gas paid, a single block's real work could reach nearly twice its gas limit.

There’s a second, subtler harm. A refund reduces the gas a transaction is charged, so more transactions fit under the block’s gas limit than the limit’s worth of actual work. A block could therefore do up to the real computation its gas limit implied — terrible for predictable block sizes, and especially bad for EIP-1559, whose whole controller depends on gasUsed reflecting genuine load.

→ Step 2: turn the dial down, don’t rip it out.

2 step Shrink, don't abolish

EIP-3529: smaller refunds, tighter cap

The fix is calibration, not abolition. EIP-3529 makes three changes: it removes the SELFDESTRUCT refund entirely, cuts the SSTORE-clear refund from 15000 to 4800, and tightens the refund cap A ceiling on how much of a transaction's gas can be returned as a refund, as a fraction of gas used. EIP-3529 lowered it from gasUsed/2 to gasUsed/5 — so at most one-fifth of a transaction's gas can come back. from gasUsed / 2 to gasUsed / 5. A modest reward for genuinely freeing state survives, but it’s now far too small to make gas tokens or the 2× block trick worthwhile.

don't remove refunds entirely — shrink and cap them before after SELFDESTRUCT refund 24000 0 SSTORE clear refund 15000 4800 max refund cap gasUsed / 2 gasUsed / 5 a modest refund for freeing state stays; the gaming does not
EIP-3529 doesn't remove refunds — it shrinks them: the SELFDESTRUCT refund goes to 0, the SSTORE-clear refund drops from 15000 to 4800, and the total-refund cap tightens from gasUsed/2 to gasUsed/5. Enough to still reward freeing state, too little to game.
Formula
maxRefund = gasUsed / 5 1 ( was gasUsed / 2 2 )
  1. 1 at most a fifth of a tx's gas can be refunded — down from a half
  2. 2 the old cap let refunds offset up to half, enabling the 2× block
Halving-to-a-fifth the cap is what bounds a block's real work back near its gas limit.

→ Step 3: the payoff, and a thread to pull later.

3 step Blocks bounded again

The payoff: predictable blocks — and a nudge toward transient storage

With refunds capped at a fifth, a block’s real work is bounded back near its gas limit instead of drifting toward twice it. That predictability is precisely what EIP-1559’s fee controller needs to read demand honestly, which is why the two shipped together.

real work per block, bounded back to the limit gas limit before ~2× limit after ≈ limit gas tokens become unprofitable — and blocks stay predictable for EIP-1559 it's also why the SSTORE-reset guard trick got costly — see transient storage
Before, refunds let a block's real work reach ~2× the gas limit; after, it's bounded near the limit. Gas tokens become unprofitable, and blocks stay predictable — exactly what EIP-1559's controller relies on.
04 Go Deeper Where to take it from here