What Happens to a Contract’s State Variables during a Mutable Upgrade?

During a mutable upgrade using a proxy pattern, the contract's state variables (data) are preserved in the proxy contract's storage. The new logic contract only dictates how that existing data is read and modified.

It is crucial that the storage layout of the new logic contract is identical to or compatible with the old one to prevent data corruption, a risk known as storage collision.

How Is the Upgrade Function Typically Triggered in a UUPS Contract?
Explain the Concept of “Rug Pull” in Relation to Mutable Contract Ownership
What Is a ‘Proxy Contract’ and Why Is It a Security Concern?
What Is a “Governance Attack” on a Mutable Contract?
Does the Proxy Pattern Affect the Cost of Contract Deployment?
What Is the Difference between a State Change and a Code Change in a Deployed Smart Contract?
What Is the Role of a Proxy Contract in Maintaining Upgradability?
What Is the Security Vulnerability Known as “Storage Collision” in Proxy Patterns?

Glossar