freecoding.school100% FREE · NO SIGNUP
The EVM CoreISSUE #20 of 48

transient storage · eip-1153

SoliaVSThe Reentrancy Reaper
Solia saysEIP-1153 transient storage (TSTORE/TLOAD) persists within a single transaction and is wiped at the end — cheap mutex state, callback context, and reentrancy guards.

EIP-1153 added TSTORE and TLOAD opcodes for transient storage: 256-bit slots that live for one transaction only and cost 100 gas per access (no init premium). They are perfect for state that needs to survive nested calls within a tx but should not consume permanent storage — reentrancy guards, callback parameter passing, and one-shot mutex flags.

At transaction end the entire transient namespace is wiped automatically, so contracts cannot leak state across transactions through it. The demo shows TSTORE/TLOAD persisting within a tx and disappearing after.

Power-ups you unlock

The Reentrancy Reaper attacks — common mistakes

Boss battleWrite a value with TSTORE, read it back within the same transaction, then show TLOAD returns 0 in the next transaction.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
let transient = {}, permanent = {};
const TSTORE = (k,v) => transient[k] = v;
const TLOAD  = (k)   => transient[k];
const SSTORE = (k,v) => permanent[k] = v;
const SLOAD  = (k)   => permanent[k];
const endTx  = ()    => transient = {};
const log = [];
log.push('=== tx 1 begin ===');
TSTORE('reentrancyGuard', 1);
SSTORE('balance', 100);
log.push('mid-tx  TLOAD reentrancyGuard = ' + TLOAD('reentrancyGuard'));
log.push('mid-tx  SLOAD balance          = ' + SLOAD('balance'));
endTx();
log.push('=== tx 1 end → transient wiped ===');
log.push('=== tx 2 begin ===');
log.push('next-tx TLOAD reentrancyGuard = ' + (TLOAD('reentrancyGuard') === undefined ? 0 : TLOAD('reentrancyGuard')) + '   (wiped)');
log.push('next-tx SLOAD balance          = ' + SLOAD('balance') + '   (persistent)');
document.getElementById('o').textContent = log.join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ Delegatecall · Context PreservationAccess Lists · Warm Vs Cold · Eip-2929/2930 ›