What problem does it solve?
Uniswap v4 hooks intercept every swap in a pool, and misimplemented hooks can lead to complete user fund loss through attack vectors like NoOp rug pulls, missing caller verification, and incorrect delta accounting. This skill provides security-first guidance to help developers build and audit v4 hooks that avoid these critical vulnerabilities.
Core Features & Use Cases
- Threat Modeling & Permission Risk Matrix: Detailed breakdown of all 14 v4 hook permissions with associated risk levels, plus guidance on safe usage patterns for each.
- Critical Vulnerability Mitigation: Step-by-step guidance to prevent the most dangerous v4 hook attacks, including NoOp rug pulls, missing PoolManager verification, and delta accounting mismatches.
- Pre-Deployment Audit Resources: Comprehensive checklists, base hook templates, and gas budget guidelines to ensure hooks are safe for mainnet deployment.
- Use Case: Ideal for developers building v4 hooks for perpetual futures exchanges, custom AMMs, JIT liquidity systems, or any contract that interacts with the Uniswap v4 PoolManager.
Quick Start
Use the v4-security-foundations skill to review your draft Uniswap v4 hook code for critical security flaws like missing caller checks and NoOp attack vectors before deploying to mainnet.