v4-security-foundations

Enforce PoolManager verification and delta accounting invariants in Uniswap v4 hooks.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/NickVanzo/hackathon-eth-global-2026 --skill v4-security-foundations-nickvanzo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: v4-security-foundations
Source: https://github.com/NickVanzo/hackathon-eth-global-2026/tree/main/.claude/skills/v4-security-foundations
Command: npx skills add https://github.com/NickVanzo/hackathon-eth-global-2026 --skill v4-security-foundations-nickvanzo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Security-first blueprint for Uniswap v4 hooks that helps developers prevent critical vulnerabilities in PoolManager callbacks, delta accounting, and router interactions by providing structured guidance and templates.

Core Features & Use Cases

  • Threat modeling guidance for v4 hooks, including access control patterns and delta accounting invariants
  • Base hook template with safe defaults and one-way permission enablement
  • Audit-ready checklist and references to production best practices
  • Reusable guidance for secure hook development, risk scoring, and deployment readiness
  • Use Case: Build secure before/after hook integrations with proper verifier checks on a pool managed by PoolManager

Quick Start

Copy the v4 Hook Security Foundations template into your project, enable only the needed permissions in getHookPermissions, implement the corresponding callbacks, and perform a security review before deployment.

Frequently Asked Questions about v4-security-foundations

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

FAQPage Schema
How do I prevent security flaws in Uniswap v4 hook development?

To prevent security flaws in Uniswap v4 hook development, use a threat-aware design that enforces PoolManager verification, delta accounting invariants, and documented patterns for safe external interactions. Apply a base hook template with safe defaults and strict access control.

What is delta accounting invariant enforcement for PoolManager callbacks?

Delta accounting invariants ensure that PoolManager callbacks maintain mathematical balance by verifying all deltas are correctly accounted for before execution. This prevents critical vulnerabilities by enforcing strict verification checks within the hook's before and after swap operations.

How do I implement access control patterns for v4 PoolManager hooks?

Implement access control patterns for v4 PoolManager hooks by enabling only necessary one-way permissions in getHookPermissions, using a base template with safe defaults, and applying structured threat modeling to restrict unauthorized external interactions.

What's the best way to audit Uniswap v4 hooks before deployment?

The best way to audit Uniswap v4 hooks is using an audit-ready checklist that validates risk scoring and deployment readiness. Perform a security review focusing on PoolManager verification, delta accounting invariants, and safe external router interactions before deployment.

When do I need threat modeling guidance for Uniswap v4 hooks?

You need threat modeling guidance for Uniswap v4 hooks when building before or after swap integrations that require verifier checks on a PoolManager-managed pool. It is essential whenever your hook interacts with external routers or manages complex delta accounting.

Does this v4 hook security template support custom router interactions?

Yes, the v4 hook security template supports custom router interactions by providing documented patterns for safe external interactions. It enforces verifier checks and delta accounting invariants to ensure external calls do not introduce critical vulnerabilities.