Curve DEX Hack
What happened
On July 30, 2023, exploiters drained several Curve Ethereum liquidity pools after a Vyper compiler flaw disabled the pools' intended cross-function reentrancy protection.
Vyper versions 0.2.15, 0.2.16, and 0.3.0 incorrectly allocated a distinct storage lock to each use of a named nonreentrant decorator. Functions intended to share one lock therefore allowed cross-function reentrancy. In affected Curve pools, native-ETH calls could transfer execution before storage updates, enabling stale-balance LP accounting.
Case & protocol details
Attack Timeline
Affected pools compiled with vulnerable Vyper releases made native-ETH calls before completing sensitive accounting. The compiler assigned separate storage locks to functions that shared the same nonreentrant key, so an attacker could re-enter between removing and adding liquidity while pool balances were stale. That let the attacker mint an inflated LP claim and withdraw pool assets after repaying flash-loan capital.
Evidence & learning
Practice this exploit pattern safely
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.