Skip to content
Yieldo

Compound V2

$147.0M
Funds stolen
Funds returned
29 Sep 2021
Date of incident
Technique
Arithmetic Error
Classification
Token & Share Accounting
Target type
DeFi Protocol
Affected chains
Ethereum
Source
No public source link

On September 29, 2021, the Ethereum lending protocol Compound shipped an on-chain upgrade to its Comptroller contract — Proposal 62 — meant to fix how the protocol calculated COMP token rewards for suppliers and borrowers. The upgrade itself introduced a new bug into that formula, and some addresses began claiming COMP far in excess of what they were owed. Early reporting on September 30 put the damage at roughly $15 million across three transactions (CoinDesk); as the scope became clearer the estimate rose to around $80 million, and after a second wave of payouts days later, to a combined $147 million at risk (rekt.news). Supplied and borrowed collateral on Compound's money markets was never touched — the bug lived only in the reward-distribution mechanism.

How the exploit worked

The Comptroller distributes COMP to each address in proportion to its share of a market's supply or borrow activity. The Proposal 62 upgrade broke the distribution factor behind that math, so calling the ordinary, public claim function — no exploit code required — started paying out inflated amounts. CoinDesk documented one address that received 91,000 COMP (about $27 million at the time) while having supplied zero assets to the protocol. A second mechanism compounded the problem: a separate Reservoir contract had been dripping 0.5 COMP per block into the Comptroller and hadn't been drained in roughly two months, building up around 200,000 COMP (~$68 million). About 3.5 days after the first wave, someone called the public drip() function, pulling that reserve into the still-broken Comptroller and triggering a second wave of oversized payouts. Nothing here bypassed access control or used reentrancy — every call went through documented, unmodified public functions. The error was purely arithmetic, in the reward-distribution factor, consistent with the "Math Mistake Exploit" label: there was no external attacker breaching a perimeter, only users calling functions that were already open to them and now paid out wrong.

What happened next

The Comptroller had no emergency pause — only governance upgrades with a mandatory voting delay. Proposal 63 temporarily disabled COMP distribution, Proposal 64 patched the underlying formula on October 8, and Proposal 65 added corrective functions afterward. Founder Robert Leshner publicly asked recipients to return excess COMP to the Compound Timelock, offering to let them keep 10% as a "white-hat" reward, and warned that non-returners would be reported to the IRS and doxxed (rekt.news). The community reaction was sharply negative, and Leshner apologized, calling it "the worst day in the history of the Compound protocol" and likening it to "a bank error in a couple people's favor" (CoinDesk). Actual voluntary returns were limited: as of October 1, CoinDesk reported only two addresses had sent back a combined 37,493 COMP, worth about $12 million at the time — a small fraction of the $147 million exposure. No lawsuits or arrests followed; Compound Labs acknowledged it had no clear legal basis to compel anonymous recipients to return funds. The protocol kept operating, and by rekt.news's assessment, the IRS threats did more lasting reputational damage than the monetary loss itself.

What this means

  • Reward-distribution contracts in liquidity mining programs carry the same blast radius as contracts holding user deposits — upgrading the emission formula is not a cosmetic change, even when "supplied/borrowed funds are not at risk" is technically true.
  • Unrestricted public utility functions like drip() can amplify an already-disclosed bug: once the first payout wave was public, anyone could call the function to trigger the second one, and someone did.
  • Governance-only contracts without an emergency pause stay exposed for as long as the voting delay lasts — the formula sat broken from September 29 to October 8, and that window was actively used.
  • Post-hoc "return it or else" appeals underperform gentler ones in decentralized systems with no legal lever to pull: only about $12 million of the $147 million exposed came back voluntarily.

On-chain DeFi carries smart-contract risk. Keep core funds on a regulated exchange.