Agent skill · research science · yaklang
smart-contract-vulnerabilities
Smart contract vulnerability playbook. Use when auditing Solidity/EVM contracts for reentrancy, integer overflow, access control, delegatecall, flash loan, signature replay, and MEV-related attack patterns.
Why this skill is useful
Adds detailed attack patterns and mitigation strategies for smart contract vulnerabilities that are not commonly known or documented.
What it needs
About 7k tokens when loaded. Last updated 2026-06-16. 1,563 stars on the source repository.
What this skill does
SKILL: Smart Contract Vulnerabilities — Expert Attack Playbook AI LOAD INSTRUCTION: Expert smart contract audit techniques. Covers reentrancy (single, cross-function, cross-contract, read-only), integer overflow, access control, delegatecall, randomness manipulation, flash loans, signature replay, front-running/MEV, and CREATE2 exploitation. Base models miss subtle cross-contract reentrancy and storage layout collisions in proxy patterns. 0. RELATED ROUTING defi-attack-patterns when the vulnerability is part of a DeFi protocol exploit (flash loans, oracle manipulation, governance attacks) deserialization-insecure when the target is off-chain infrastructure deserializing blockchain data Advanced Reference Also load SOLIDITYVULNPATTERNS.md when you need: Side-by-side vulnerable vs fixed code patterns for each vulnerability class Gas optimization traps that introduce vulnerabilities Proxy pattern storage collision examples with slot calculations --- 1. REENTRANCY The most iconic smart contract vulnerability. External calls transfer execution control; if state is not updated before the call, the callee can re-enter. 1.1 Classic Reentrancy (Single-Function) 1.2 Cross-Function Reentrancy Two functions share state; attacker re-enters a different function during callback: Step Execution State --- --- --- 1 Call withdraw() → external call balance still positive 2 Attacker fallback calls transfer(attacker2) balance used before reset 3 transfer reads stale balance → moves funds attacker2 receives tokens 4 Original withdraw completes, zeroes balance damage done 1.3 Cross-Contract Reentrancy Contract A calls Contract B, which calls back into Contract A (or Contract C that reads A's stale state). Especially dangerous in DeFi protocols where multiple contracts share state. 1.4 Read-Only Reentrancy The re-entered function is a view function used by a third-party contract for price calculation. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills yaklang/smart-contract-vulnerabilities