Delegate execution makes layout compatibility part of correctness.
LET’S PICTURE IT
A new cabinet instruction manual must still match the positions of existing 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.
Identify whose storage is used
With delegatecall, implementation code operates on the caller’s storage context. For a typical proxy, stored application state belongs to the proxy address.
Preserve existing field meaning
Moving or changing a field can make new code interpret old bytes under a different type or position. Successful compilation does not detect every upgrade compatibility problem.
Compare both complete layouts
Include inherited variables, structs, packed offsets and dynamic roots. Checking only a list of top-level variable names is insufficient.
Treat initialization separately
An implementation constructor does not initialize proxystorage through a later delegatecall. Initializer access and one-time execution need their own design and tests.
Inspect the layout
Old: slot 0 = uint256 count
Unsafe new interpretation: slot 0 = address owner
The existing bytes do not move themselves into a compatible new schema.
A conceptual compatibility example, not an upgrade recipe.