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

Review an upgrade storage change

Preserve old state meaning while reviewing new authority.

LET’S PICTURE IT

A new manual must still match the cabinet and its key holders.

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.

Collect complete old and new layouts

Use exact sources, inherited declarations and compiler settings. Compare slot, byte offset and type for existing fields.

Inspect the proposed change

Reordering fields, changing widths or altering nested structures can reinterpret existing bytes. Appending fields also requires the relevant pattern’s compatibility analysis.

Review the execution and authority paths

Determine who can install the implementation and how initialization runs. Correct layout does not compensate for an unprotected upgrade function.

Test with populated old state

Set representative records, upgrade locally and assert preserved values and permissions. Include packed fields, dynamic structures and failed unauthorized attempts where present.

Your acceptance target

old: slot 0 count; slot 1 owner
unsafe new: slot 0 owner; slot 1 count

Reject reinterpretation; inspect complete layout and upgrade authority.

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

QUICK CHECK · NO PRESSURE

Does matching layout alone establish a secure upgrade?

Your progress stays in this browser.
Keep exploring the original referencedocs.openzeppelin.com ↗

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