# storage layout must remain consistent across proxy implementation versions Because [[delegatecall executes code from another contract using the callers storage context]], all state writes from the implementation land in the proxy's storage slots. New implementation versions must only append variables to the end of the layout — never reorder, remove, or insert variables before existing ones. Violating this constraint corrupts state because variable N in the new implementation maps to the slot that held variable N in the old implementation, regardless of name or type. Standards like [[eip-1967 reserved storage slots prevent proxy implementation address collisions]] and [[eip-7201 namespaced storage provides structured collision avoidance for upgradeable contracts]] provide systematic approaches to preventing collisions. --- Relevant Notes: - [[EIP-7702 storage collision attacks occur when migrating between delegate contracts with incompatible layouts because existing EOA storage is not cleared on re-delegation]] — extends this note to EOA re-delegation: the same layout consistency requirement applies but has no enforcement mechanism in EIP-7702 since there is no upgrade administrator to coordinate changes - [[delegatecall executes code from another contract using the callers storage context]] — the mechanism that creates this requirement - [[eip-7201 namespaced storage provides structured collision avoidance for upgradeable contracts]] — a systematic defense Topics: - [[vulnerability-patterns]] - [[evm-internals]]