Skip to content
RED SAGSkills
mediumBlockchain Developer interview question

How do upgradeable smart contracts work, and what are the trade-offs?

What the interviewer wants to hear

  • Proxy holds state and delegates calls to an implementation
  • Transparent, UUPS and beacon proxy patterns
  • Initializer functions instead of constructors
  • Storage layout compatibility rules
  • Trust and governance trade-off: who can upgrade
  • Timelocks and multisig for upgrades

Model answer

An upgradeable contract is split in two. Users talk to a proxy contract, which holds all the state and funds and forwards each call using delegatecall to an implementation contract that contains the logic. To upgrade, an admin points the proxy to a new implementation, and the state stays in place. Common patterns are Transparent proxies, where upgrade logic sits in the proxy, UUPS, where it sits in the implementation and is cheaper, and Beacon proxies for many proxies sharing one implementation. Because constructors do not run in the proxy context, we use initializer functions protected against being called twice. New versions must keep the storage layout, only appending variables, or use namespaced storage. The big trade-off is trust: upgradeability lets you fix bugs but also lets whoever holds the key change the rules. So I put upgrades behind a multisig and timelock, so users can see and react to changes.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Blockchain Developer questions