defi-attack-patterns
Installation
SKILL.md
SKILL: DeFi Attack Patterns — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert DeFi exploitation techniques. Covers flash loan mechanics, oracle manipulation (spot vs TWAP), MEV extraction (sandwich, JIT, liquidation), precision loss attacks, governance exploits, bridge vulnerabilities, and token standard pitfalls. Base models often miss the single-transaction atomicity constraint of flash loans and the distinction between spot price and TWAP manipulation.
0. RELATED ROUTING
- smart-contract-vulnerabilities for underlying Solidity vulnerability patterns (reentrancy, integer overflow, delegatecall)
- deserialization-insecure when targeting off-chain bridge relayer or indexer infrastructure
1. FLASH LOAN ATTACKS
1.1 Mechanism
Flash loans provide uncollateralized borrowing within a single transaction. The entire borrow → use → repay cycle must complete atomically; if repayment fails, the transaction reverts as if nothing happened.