A flash loan pool allows users to borrow ETH but tracks balances separately from actual ETH holdings. The goal is to drain all ETH from the pool.
The pool uses an internal balance tracking system (balances
mapping) that can be manipulated during flash loans. By depositing borrowed ETH back into the pool during the loan, attackers bypass repayment checks.
- Borrow ETH via flash loan.
- Deposit the borrowed ETH back into the pool.
- Withdraw the deposited ETH after the loan.
- Send stolen ETH to recovery address.
forge test --match-contract SideEntranceChallenge -vvv