Governance Proposal 62 split COMP rewards into separate supply-side and borrow-side speeds. Inside distributeSupplierComp, the guard that initializes a first-time supplier's index used > where it needed >=. For a market whose supply index was still exactly compInitialIndex, the branch never fired, the supplier's index stayed at 0, and the reward delta became the entire 1e36 index. Users started claiming COMP by the truckload — and because Compound governance requires a 7-day process, everyone watched the bug pay out for a week with no way to stop it.
// ❌ shipped in Proposal 62 if (supplierIndex.mantissa == 0 && supplyIndex.mantissa > compInitialIndex) { supplierIndex.mantissa = compInitialIndex; // 1e36 } Double memory deltaIndex = sub_(supplyIndex, supplierIndex); uint supplierDelta = mul_(supplierTokens, deltaIndex); // ✅ fixed in Proposal 64 if (supplierIndex.mantissa == 0 && supplyIndex.mantissa >= compInitialIndex) { supplierIndex.mantissa = compInitialIndex; } // With > : supplyIndex == compInitialIndex == 1e36 → branch skipped // supplierIndex stays 0 → deltaIndex = 1e36 − 0 = 1e36 // rewards paid against an index of 1e36 instead of 0. → result: ~$147M of COMP accrued and claimable in error
Entries in the SAFE database that describe this failure. These share its failure class.
Every figure on this page comes from the post-mortems above, not from us. Losses are US dollars at the time of the incident.
Arithmetic is one of the 203 classes the SaferICO scanner checks for. It will not review your signing process — but it will read your Solidity.