Curriculum·G303 Storage, Upgrades, and Trust·about 34 min
Upgradeability is power that must be guarded
By the end of this lesson you can
- →Explain that an upgrade mechanism is the power to replace a contract's entire logic
- →Describe how control of PAID Network's upgrade let an attacker mint about 59 million tokens
- →Reason that whoever controls the upgrade controls everything, so upgradeability is concentrated privilege
- →Guard an upgrade key the way you guard the most dangerous function, with multisig and timelock
Graduate · enrolled learners
This lesson opens with PAID Network, March 2021.
- What happened
- PAID Network used an upgradeable contract, meaning its logic could be replaced by whoever controlled the upgrade. An attacker gained control of that upgrade power, through the single private key that controlled the upgrade, upgraded the contract to a malicious version, and used it to mint about 59 million new PAID tokens out of nothing, crashing the token's price by roughly 89 percent, from about 2.86 dollars to about 0.32. They dumped some of the minted supply for around 3 million dollars in ether before the team pulled liquidity and blocked PAID/ETH swaps on Uniswap, and the notional damage to holders ran to tens of millions; PAID said it would restore balances to their pre-hack state. No cryptography was broken and the token contract's normal rules were never the issue: the attacker did not exploit the logic, they replaced it, because controlling the upgrade meant controlling the contract. The right to upgrade was the right to rewrite every rule the contract enforced, and once the attacker held it, the contract did whatever they now wrote it to do.
- The decision point
- An upgrade mechanism is the power to replace a contract's entire logic, so whoever controls the upgrade controls everything the contract can do, which makes upgradeability not a convenience but a concentrated privilege more dangerous than any single function. PAID Network is the case: an attacker who gained control of the upgrade power replaced the contract with a malicious version and minted about 59 million tokens from nothing, causing tens of millions in notional damage, not by exploiting the contract's logic but by rewriting it. This follows directly from the prior lesson: since a contract is code over state and the code defines what the state means, the ability to change the code is the ability to change everything, so an upgrade key is the master key, and it must be guarded exactly like, and more carefully than, the most dangerous function in the contract. A single deployer key that can upgrade is a single point at which someone can rewrite the whole system, which is why upgrade power belongs behind a multisig, so no one person holds it, and a timelock, so a malicious upgrade is visible and delayable before it takes effect. So the discipline is to treat the upgrade mechanism as the highest-value target in the system, to never let it rest on a single key, and to make any upgrade slow and visible, because the right to upgrade is the right to rewrite the contract under users' feet, and PAID Network is what that right does in the wrong hands: it turns the contract into whatever the attacker now wants it to be.
- Recorded loss
- $27,000,000
What you will be able to answer
- →How was PAID Network exploited (March 2021)?
- →What is an upgrade mechanism, in terms of power?
- →Why is an upgrade key a master key?
- →How should upgrade power be guarded?
Orientation and Year One are open: anyone can read them without an account. From Year Two onward the lessons are for enrolled learners, because progress through the later years only means anything if it is tracked against a record.
It is free. We do not sell the list and there is nothing to buy at the end of it.
Sources and review
- https://rekt.news/paid-rekt
- https://www.certik.com/blog/paid-network-post-mortem
- https://www.halborn.com/blog/post/explained-the-paid-network-hack-march-2021
- https://consensys.github.io/smart-contract-best-practices/
Confidence high·Volatility low·Reviewed 2026-09-17·Owner unassigned
Contested
The roughly 27 million dollar figure is Rekt's 'total rugged amount' (27,418,034 dollars) for the 59,471,745 PAID minted on 5 March 2021; Halborn values what the attacker extracted at roughly 100 million dollars, so the figure depends on the price used. Rekt counts 2,079.6 WETH (about 3.1 million dollars) realized and Halborn 2,040.4 ETH before the team blocked PAID/ETH swaps; the team said it would restore balances to their pre-hack state. The lesson uses the upgrade-control mechanism, not a precise loss.
How the attacker came to hold the upgrade is not settled. CertiK says the proxy owner's private keys were used or compromised and that it could not confirm what happened before ownership was transferred to the attacker about 30 minutes before the mint; Halborn says the network relied on a single private key and adopted multisig control for upgrades afterward; Rekt raises the possibility of an insider. The durable point, that controlling the upgrade means controlling the contract, holds regardless of how the key was obtained.
