Curve DEX Hack

TOTAL LOST $61.7M
High Reentrancy Ethereum

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.

Technical Root Cause

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

Classification Reentrancy
Protocol Type DEX
Smart Contract Language Vyper
Official Website curve.finance
Protocol Twitter/X @CurveFinance

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.

Practice this exploit pattern safely

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.