v4-security-foundations

Propose a security-first framework for Uniswap v4 hooks covering threat models and delta accounting.

3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/0xharryriddle/codex-field-kit --skill v4-security-foundations-0xharryriddle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: v4-security-foundations
Source: https://github.com/0xharryriddle/codex-field-kit/tree/main/archive/upstream/chasebuild-agent-skills/web3/skills/v4-security-foundations
Command: npx skills add https://github.com/0xharryriddle/codex-field-kit --skill v4-security-foundations-0xharryriddle

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Security-first guide for building Uniswap v4 hooks. Hook vulnerabilities can drain user funds—understand these concepts before writing any hook code.

Core Features & Use Cases

  • Threat modeling, delta accounting, and risk-aware hook design for v4
  • Patterns for PoolManager verification, router allowlisting, and safe upgrade practices
  • Template and checklist resources to audit and deploy production-ready hooks
  • Use Case: A developer building a new v4 hook can reference these foundations to implement secure callbacks and pass audits

Quick Start

Review the threat model and enable only the necessary protections in your v4 hook project before implementing callbacks.

Frequently Asked Questions about v4-security-foundations

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

FAQPage Schema
How do I build secure Uniswap v4 hooks?

Secure Uniswap v4 hooks require a security-first framework focusing on threat modeling, delta accounting, and access control to prevent fund loss. Review the threat model and enable only necessary protections before implementing callbacks.

What are common v4 hook vulnerabilities that drain user funds?

V4 hook vulnerabilities that drain user funds typically stem from incorrect authorizations and improper delta handling. Applying defense-in-depth patterns and risk-oriented guidance mitigates these security threats during development and auditing.

How do I implement access control for a Uniswap v4 hook?

Implement access control for a Uniswap v4 hook by applying patterns for PoolManager verification and router allowlisting. These security-first practices ensure only authorized callers execute sensitive hook callbacks.

How do I audit Uniswap v4 hooks for delta accounting issues?

Audit Uniswap v4 hooks for delta accounting issues by using template and checklist resources designed for risk-aware hook design. This framework guides testing to identify incorrect delta handling that could lead to fund loss.

What are safe upgrade practices for v4 hook smart contracts?

Safe upgrade practices for v4 hook smart contracts involve applying defense-in-depth patterns and risk-oriented guidance. Reference security-first foundations to maintain authorization integrity and prevent vulnerabilities during contract upgrades.