Independent discussion of crypto, wallets, cards and markets
Forum Home > Learning & Discussion > Concepts & Explainers > Smart contract upgrades: proxies, migrations and who controls what
Smart contract upgrades: proxies, migrations and who controls what88 replies · 4,616 views
Thread ToolsShow Printable Version · Subscribe to this Thread · Search Thread
Where to open an account: Open a Trustee account.

Smart contract upgrades: proxies, migrations, and who controls what

Why contracts need upgrades at all

Smart contracts deployed to a blockchain are immutable by default: the bytecode at an address never changes, and bugs or needed improvements cannot be patched in place. That immutability is the security model - code does what it says forever - and it is also the operational problem. Protocols that need to fix bugs, add features, or adapt to changing conditions face a choice: ship immutable replacements and move users, or build upgrade mechanisms that trade some immutability for controllability. Every upgrade architecture is a decision about who gets to change the code, and how much trust that decision requires.

The proxy pattern: indirection as upgradeability

  • How proxies work: the user interacts with a proxy contract that stores no logic itself but delegates calls to a separate implementation contract. Upgrades swap the implementation the proxy points to - the address users interact with stays the same while the behavior behind it changes.
  • The storage problem: proxies must preserve state across implementation swaps, which is why storage layouts are versioned and why a careless upgrade - changing storage ordering or types - corrupts the protocol's history. Upgrade discipline is storage discipline.
  • The control question: the proxy holds an admin - an entity or contract authorized to point it at new implementations. That admin is the upgrade's real authority, and its structure decides who controls the protocol: a single key, a multisig, a timelock, or a token-holder vote.
  • The trust cost: upgradeability means the code users audit is not permanently the code users run. The audit covers today's implementation; tomorrow's arrives through the admin - which is why governance structure is part of the security model, not separate from it.

The admin structures, ranked by trust

  • Externally owned: one key controls upgrades. Fastest to act, highest concentration risk - the classic single-point-of-failure, and the structure that makes "immutable" claims about upgradeable contracts meaningless.
  • Multisig: a set of key-holders must cooperate. Reduces single-key risk but concentrates trust in the signers, whose identity and incentives are the real question.
  • Timelock plus governance: upgrades are proposed by a governance body, delayed by a public timelock, then executed. Users get notice - the delay is the warning window - and the structure converts upgrade control into a political process with a paper trail.
  • Immutable after a date: some protocols schedule the moment upgradeability ends - the admin is renounced, and the code freezes. The freeze date is a commitment device: it tells users exactly when the trust cost stops accruing.

Migrations: the hard upgrade

  • What migrations are: when an upgrade is too large for a proxy swap - new architecture, new token, new chain - protocols run migrations: users move assets or positions from the old contract to a new one, often through a claim window.
  • The migration risk: migrations concentrate risk in a window - users must act within deadlines, bridge assets through new infrastructure, and trust that the new contract matches the old promises. Migration windows are when protocols bleed users who miss deadlines or fall for fake migration sites.
  • The governance trigger: migrations are usually governance decisions - votes, delegations, and campaigning - which means migration outcomes reflect governance participation levels, and low-turnout protocols can be migrated by small minorities.

Reading an upgradeable protocol honestly

The takeaway

Smart contract upgrades trade immutability for controllability: proxies delegate behavior to swappable implementations, and the admin behind the proxy - single key, multisig, timelock governance, or a scheduled freeze - decides who actually controls the protocol. Migrations are the hard upgrade: asset-moving windows with deadlines, fake-site risk, and governance-turnout consequences. Reading upgradeable protocols honestly means mapping the admin, reading the freeze commitments, verifying storage discipline across upgrade history, and treating migrations as governance events with real risk. The code's immutability was never the whole security model; on upgradeable protocols, the governance structure is the security model - and it is the part users audit least.

Thread Statistics88 replies · 4,616 views