Upgradeable Contracts
Proxy patterns.
The Immutability Problem
Deployed contract code cannot be changed. If you find a bug or need a new feature, the code is frozen at its address.
Upgradeable contracts work around this using a proxy pattern that lets you swap the logic while keeping the same address and data.
The Proxy Pattern
Upgradeability splits a contract into two parts:
- Proxy — holds the state and a pointer to the logic; users interact with it.
- Implementation — holds the code, no permanent state.
The proxy delegatecalls into the implementation, so logic runs against the proxy's storage.
All lessons in this course
- Why OpenZeppelin
- Access Control
- Token Extensions
- Upgradeable Contracts