In this track: Storage, memory and layout
advanced · 4 MIN READ

Transient storage explained

Transaction-scoped state differs from both persistent storage and per-frame memory.

LET’S PICTURE IT

A shared temporary checklist is cleared after the whole transaction finishes.

SEE IT FOR YOURSELF
Pack small values into Solidity storage slotsStep 1 / 4
Pack small values into Solidity storage slotsFirstuint128 A16 bytesSeconduint128 B16 bytesThirduint256 C32 bytesSimple elementary types only; not a complete compiler layoutSlot 0 · 32 bytesUnused · 16 BA · 16 BHigh-order bytes ← → low-order bytesSlot 0 · fullB · 16 BA · 16 BDeclaration order and sizes determine this packingSlot 0BASlot 1C · 32 bytesTry different sequences in the storage-layout tool

In this simple default-layout example, two uint128 values come before one uint256. Each slot holds thirty-two bytes.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Identify the lifetime

Transient storage lasts for one transaction and is cleared afterward. It is not a mechanism for saving values for the next transaction.

Separate it from frame memory

It can communicate between relevant frames belonging to the same storage owner within a transaction. Ordinary memory belongs to an execution frame and has different sharing behavior.

Respect call context and rollback

Transient writes follow ownership and rollback rules. A reverted scope rolls back its transient changes, and delegatecall uses the caller’s transient storage context.

Design cleanup for composability

A transaction-scoped lock still needs correct release behavior when later operations in the same transaction should proceed. End-of-transaction clearing does not replace careful control flow.

Inspect the layout

TSTORE: write a transient key
TLOAD: read a transient key

Transaction ends → transient values are discarded.

The local packing tool models elementary persistent layout only; it does not execute transient opcodes.

TURN UNDERSTANDING INTO PRACTICEOpen the Storage layout →
QUICK CHECK · NO PRESSURE

When is transient storage cleared?

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.