Changing the contract that an Ethereum account delegates to through EIP-7702 requires a storage migration check. The new code can encounter state left by the previous implementation. Removing the delegation indicator is a different operation from clearing that state, which is why the specification treats a switch between delegate contracts as a security-critical change.
| What you need to know |
|---|
| EIP-7702 lets an account delegate code execution to another address. |
| Its storage-management guidance warns about collisions when changing delegate contracts. |
| An authorisation to the zero address clears the account code. |
| The protocol does not provide a native operation to clear all account storage. |
The EIP-7702 storage guidance recommends particular care when the replacement code was not designed and tested as an upgrade to the old code. Both implementations can use the account’s storage. A location that meant one thing to the earlier implementation may mean something different to its replacement. That creates a compatibility question even if the new delegate contract works correctly with a fresh account.
Code removal and storage cleanup have different scope
In its behaviour rules, EIP-7702 specifies that a valid authorisation to the zero address clears the account’s code. The storage section separately discusses clearing account storage and says the protocol does not natively offer that operation. Taken together, these passages do not support treating delegation removal as a factory reset of the account. A later migration still needs to account for earlier storage use.
The specification suggests namespaced storage, giving ERC-7201 as an example. Namespaces place groups of variables at locations derived from identifiers so implementations can avoid accidental overlap. ERC-7201’s security section adds an easily missed qualification: the annotation used to describe a namespace does not make the compiler enforce the pattern. The developer remains responsible for implementing the claimed layout. Seeing the annotation in source code is therefore insufficient evidence of a safe migration.
For a wallet developer reviewing a replacement delegate, compare the locations used by each implementation and check the account’s prior delegations. The EIP says a special-purpose delegate could implement storage clearing where needed. It does not supply a universal cleanup transaction for users to sign. Such code itself receives powerful account access, so a generic instruction to delegate to an unfamiliar cleaner would introduce another security decision.
Our earlier explanation of failed transactions and EIP-7702 delegation covers why a failed execution can leave a delegation in place. This migration question comes later: after changing or removing that code reference, what state can another implementation encounter? The answer requires the actual storage layouts and account history. This is a comparison of published protocol specifications; no wallet migration or storage cleanup was performed.






