skills/case-studies/curve-reentrancy/SKILL.md
Case study of the 2023 Curve reentrancy exploit: Vyper compiler bug draining ~$70M
npx skillsauth add apegurus/solidity-argus curve-reentrancyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In July 2023, several Curve Finance liquidity pools (alETH, msETH, pETH) were exploited for approximately $70 million. Unlike most reentrancy attacks caused by developer error, this was caused by a bug in the Vyper compiler (versions 0.2.15, 0.2.16, and 0.3.0) that failed to properly implement reentrancy guards.
The vulnerability was a compiler-level bug in Vyper's @nonreentrant decorator. In the affected versions, the compiler used the same storage slot for reentrancy locks across different functions if they were in the same "reentrancy group", but it failed to correctly handle the lock state in certain scenarios involving cross-function calls. This allowed an attacker to re-enter a contract through a different function even if both were marked @nonreentrant.
add_liquidity and remove_liquidity functions).add_liquidity to deposit assets.add_liquidity, the contract made an external call (e.g., to a token's transfer or fallback function).remove_liquidity.0xa84aa0650c3e6f849339384388e1a769a540003ade07ba379c2d3efc4fb7ca7dtesting
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.