Loading...
Loading...
Adversarial scenario analysis and threat modeling for Solidity smart contracts. Use when analyzing contracts from an attacker's perspective, identifying multi-step attack vectors, or performing threat modeling. Covers flash loan attacks, oracle manipulation, MEV/front-running, governance exploits, reentrancy scenarios, access control bypasses, economic logic exploits, and cross-contract composability risks. Triggers on tasks involving adversarial analysis, threat modeling, attack scenarios, attack vectors, exploit analysis, or red team review.
npx skill4agent add whackur/solidity-agent-toolkit solidity-adversarial-analysis| Step | Action | Key Question |
|---|---|---|
| 1. Identify Assets | Map valuable targets | What can be stolen, locked, or manipulated? |
| 2. Enumerate Entry Points | List all external/public functions | Which functions change state or move value? |
| 3. Model Adversary | Define attacker capabilities | What resources (flash loans, MEV, tokens) does the attacker have? |
| 4. Construct Sequences | Build multi-step attack paths | What sequence of calls achieves the attack goal? |
| 5. Verify Invariants | Check contract assumptions | Which mathematical or state invariants can be violated? |
| Category | Severity | Key Indicators | Example Attack |
|---|---|---|---|
| Reentrancy | Critical | External calls before state updates, missing guards | Drain via fallback re-entry |
| Flash Loan | Critical | Price-dependent logic, spot price reliance | Borrow → manipulate → profit |
| Oracle Manipulation | High | External price feeds, single-source oracles | Inflate collateral value |
| MEV / Front-running | High | DEX interactions, unprotected swaps | Sandwich attack on swap |
| Governance | High | Token-weighted voting, timelocks | Flash-borrow votes |
| Access Control | Critical | Initializers, proxy patterns, ownership | Unprotected initializer takeover |
| Economic / Logic | High | Reward calculations, share math, minting | Rounding exploit in rewards |
| Cross-contract | High | Token callbacks, composability assumptions | Malicious ERC777 callback |
totalDeposits <= balanceblock.numberblock.timestampsolidity-agent-toolkitanalyze_adversarial_scenariosadversarial_analysisadversarial://listadversarial://category/{category}match_vulnerability_patternsrun_slitherrun_aderyn