Proxy Concepts
- Proxies. A proxy holds state and delegates logic elsewhere: upgrade means pointing at new logic.
- delegatecall. delegatecall runs foreign code against your storage: the mechanism, and the razor blade, of proxies.
- Transparent and UUPS. Proxy families differ in where upgrade logic lives: patterns chosen, trade-offs documented.
Storage Layout
- Layout compatibility. Upgrades must preserve storage layout: a reordered variable silently corrupts everything after it.
- Storage gaps. Upgradeable bases reserve gap slots: room for future fields without shifting children.
- Initializers. Proxied contracts use initializers, not constructors: and guard them against re-initialisation attacks.
Upgrade Risk and Governance
- Upgrade power. Whoever can upgrade can take everything: upgrade keys are the system’s real owner.
- Timelocked governance. Upgrades pass through timelocks and multisigs: users see changes before they bite.
- Immutability as feature. Sometimes the right upgrade policy is none: immutable contracts as a trust product.
Before and after this level
- Before: Level 12: Cryptography & Signatures: Hashing and Signing, Message Verification, Authorisation Patterns.
- Next: Level 14: DeFi Contract Patterns: Pools and Exchanges, Lending and Vault Concepts, Composable Smart Contracts.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Solidity Level 13: Upgradeability cover?
Proxy Concepts, Storage Layout, Upgrade Risk and Governance: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 12: Cryptography & Signatures, which covers Hashing and Signing, Message Verification, Authorisation Patterns.