✅3. Simple AMM Vault
Codebase walkthrough
// Initial setup creates the following state:
// 1. Deploy GREY token and mint 4000 GREY to Setup
// 2. Deploy SimpleVault and SimpleAMM
// 3. Deposit 1000 GREY → get 1000 SV (1:1 ratio initially)
// 4. Distribute 1000 GREY as rewards (increases totalAssets to 2000)
// 5. Add liquidity: 1000 SV + 2000 GREY to AMM poolBug description
Step 1: Initial Setup
Step 2: Flash Loan 1000 SV
Step 3: SV Token Replacement (in callback)
Step 4: The Broken Invariant
Step 5: Exploit the Phantom Value
PoC
Last updated