uniswap-v4-hooks

Guide secure Uniswap v4 hook development with vulnerability patterns and code templates.

17|3|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/igoryuzo/uniswapV4-hooks-skill --skill uniswap-v4-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uniswap-v4-hooks
Source: https://github.com/igoryuzo/uniswapV4-hooks-skill/tree/main
Command: npx skills add https://github.com/igoryuzo/uniswapV4-hooks-skill --skill uniswap-v4-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers build secure Uniswap V4 hooks by embedding best practices, vulnerability patterns, and secure code templates directly into the AI-assisted development workflow, preventing costly exploits.

Core Features & Use Cases

  • Security Guidance: Provides real-time advice on threat modeling, dangerous patterns (like NoOp rug pulls), and secure coding practices.
  • Code Templates: Offers secure, audited code templates for common hook functionalities.
  • Vulnerability Awareness: Educates on common pitfalls such as delta accounting errors, overflow risks, and incorrect sender identification.
  • Use Case: A developer is creating a dynamic fee hook. They can ask the AI for a secure template, get warnings about potential reentrancy issues, and receive guidance on correctly implementing the beforeSwap function with proper access control and delta handling.

Quick Start

Use the uniswap-v4-hooks skill to create a basic afterSwap hook.

Frequently Asked Questions about uniswap-v4-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Uniswap v4 hooks securely in Solidity?

To implement Uniswap v4 hooks securely, use audited code templates for functions like beforeSwap and afterSwap, and follow best practices for access control, router verification, and delta accounting to prevent exploits.

What are common security vulnerabilities when developing Uniswap v4 hooks?

Common Uniswap v4 hook vulnerabilities include delta accounting errors, overflow risks, incorrect sender identification, NoOp rug pulls, and reentrancy issues that exploit incorrect access control or router verification.

How does delta accounting work in Uniswap v4 PoolManager hooks?

Delta accounting in Uniswap v4 PoolManager hooks tracks token flow differences during execution. Secure development requires precise delta handling to ensure all balance changes settle correctly before the transaction completes.

Can I use this to add dynamic fees to a Uniswap v4 pool?

Yes, you can create a dynamic fee hook for Uniswap v4. The Skill provides secure templates for hook functionalities and warns about potential reentrancy issues when implementing the beforeSwap function.

When do I need router verification in my Uniswap v4 hook?

Router verification is needed in Uniswap v4 hooks whenever external calls trigger pool operations. Correctly identifying the sender prevents unauthorized access and protects against dangerous patterns like NoOp rug pulls.

Why does my afterSwap hook fail access control checks?

An afterSwap hook fails access control checks if it lacks proper router verification or incorrect sender identification. Implementing secure code templates with strict access control prevents these authorization failures.