A vault lets a user deposit and withdraw in the same transaction with share price driven by an external, flash-manipulable quantity (spot price, reserves). The attacker deposits, pumps the priced quantity, and withdraws more than they put in.
// 1. deposit at price P // 2. flash-manipulate the pool so share price = 2P // 3. withdraw same shares -> 2x assets out, all in one tx.
// snapshot price at deposit; block same-block deposit+withdraw; use TWAP
require(lastDeposit[msg.sender] != block.number, "same block");
Largest recorded losses in the same failure class — related, not the same bug:
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0223 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.