Building a DeFi Exploit Detection Lab: Foundry Invariant Tests That Would Have Caught $100M in Hacks
Your smart contracts passed every unit test. All edge cases covered. Code coverage: 98%.
Then someone calls three functions in a sequence nobody imagined, and $40 million disappears.
Unit tests verify what you expect. Invariant tests find what you di...
dreamworksecurity.hashnode.dev10 min read