Curriculum·Graduate·G304
Testing and the Toolchain
Yam Finance, August 2020. Yam launched to enormous demand, holding hundreds of millions of dollars in value within days, on a contract that had not been audited.
Lesson 1 opens on
Yam Finance, August 2020
Yam launched to enormous demand on a contract that had not been audited, and within days it held hundreds of millions of dollars in value. A bug lived in its rebase logic, the code that periodically adjusts the token supply, and when that logic ran under real conditions it minted far more YAM, the governance token, than intended and sent the excess to the protocol reserve. Because a proposal needed a share of all YAM to reach quorum, the excess supply broke the very mechanism the community would have used to pass a proposal fixing the bug, so the project could not repair itself and effectively failed within about two days.
The lessons
- G304-01Test the unhappy path you did not imagineExplain that testing means exercising the unhappy paths and edge cases, not just the intended flowabout 34 min · opens on Yam Finance, August 2020
- G304-02Edge cases, and the math you did not fuzzExplain that bugs hide in the extreme and unusual inputs that example-based tests never reachabout 34 min · opens on Indexed Finance, October 2021
- G304-03Shipping unreviewed: the cost of skipping the workExplain that skipping review and audit is not a shortcut but a larger cost deferred to exploitationabout 34 min · opens on Grim Finance, December 2021
- G304-04The migration and deployment checklistExplain that migrations and deployments are high-risk moments that need a disciplined checklistabout 34 min · opens on Uranium Finance, April 2021
