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
In this simple default-layout example, two uint128 values come before one uint256. Each slot holds thirty-two bytes.
In this simple default-layout example, two uint128 values come before one uint256. Each slot holds thirty-two bytes.The first sixteen-byte value occupies the low-order half of slot zero. Low-order bytes are shown on the right.The second uint128 fits in the remaining sixteen bytes. Both values now share slot zero.C needs a complete thirty-two-byte slot, so it begins at slot one. Two packed small values plus C use two slots.
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.