In this track: Connect everything together
advanced · 6 MIN READ

Build a storage packing visualizer

Make slot boundaries and low-order offsets visible.

LET’S PICTURE IT

Arrange fixed-size pieces in numbered thirty-two-byte drawers.

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.

Define a deliberately small subset

Support a simple sequence of elementary value types with known byte widths. Do not imply complete support for structs, mappings, arrays or inheritance.

Place fields by the layout rule

Pack a field if it fits the remaining slot space. Otherwise start a new slot; the first field is lower-order aligned.

Label the coordinate system

Show slot number, byte offset and width. If high-order bytes are drawn on the left, offset zero should appear at the right end.

Verify independent output

Compare known cases with compiler storageLayout results. Show exclusions beside the tool so users do not treat it as an upgrade compatibility checker.

Your acceptance target

uint128 a → slot 0, offset 0
uint128 b → slot 0, offset 16
uint256 c → slot 1, offset 0

Use only local examples and public sample addresses. State the assumptions and limits alongside the result.

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

What is b’s byte offset after uint128 a in the same slot?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

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