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

Compute an address mapping slot

Hash the full padded key and declared base slot.

LET’S PICTURE IT

A directory combines the record name with the directory identifier.

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.

State the assumed declaration

Use mapping(address => uint256) at declared slot five. The numeric slot is an exercise assumption, not a universal mapping location.

Write both words

Encode address one as a full padded address word and slot five as a uint256 word. Their concatenation is sixty-four bytes.

Apply Keccak to the bytes

Hash that encoded byte sequence, not a text description or a twenty-byte packed address plus slot. The result identifies the entry slot under this layout.

Separate calculation from a state read

This exercise computes a location locally. It does not query that slot, verify a token implementation or establish a balance.

Your acceptance target

key: address 1
base slot: 5
entry slot: 0x1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b

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

TURN UNDERSTANDING INTO PRACTICEOpen the Keccak-256 →
QUICK CHECK · NO PRESSURE

Does this calculation alone reveal the live value stored there?

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.