v4-security-foundations

Define threat models and permissions for secure Uniswap v4 hook development.

2|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/simulatedrealty/PSYOPS-Solana-Copilot --skill v4-security-foundations-simulatedrealty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: v4-security-foundations
Source: https://github.com/simulatedrealty/PSYOPS-Solana-Copilot/tree/main/.agents/skills/v4-security-foundations
Command: npx skills add https://github.com/simulatedrealty/PSYOPS-Solana-Copilot --skill v4-security-foundations-simulatedrealty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Security-first guidance for Uniswap v4 hook development, providing threat modeling, safe patterns, and a robust base template to reduce vulnerability risk.

Core Features & Use Cases

  • Threat modeling and risk-aware hook design for v4
  • Delta accounting patterns, access-control scaffolding, and audit-ready templates
  • Base Hook Template with all permissions disabled by default for safe starting point
  • Use Case: teams shipping v4 hooks with strong security foundations and auditable checklists

Quick Start

Copy the v4 security foundations template, enable only the needed callbacks in getHookPermissions, implement them, and deploy with the correct pool manager address.

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 common vulnerabilities when building Uniswap v4 hooks?

To prevent vulnerabilities in Uniswap v4 hooks, use a security-first foundation that enforces pool manager verification and safe delta accounting. This approach defines threat models and provides templates for robust, auditable hook development.

What are the best practices for delta accounting in v4 hook development?

Best practices for delta accounting in v4 hooks involve using risk-aware design patterns that properly track token balances and enforce pool manager verification. Audit-ready templates ensure these accounting mechanisms remain robust against manipulation.

How do I set up safe permissions for a Uniswap v4 hook?

Set up safe v4 hook permissions by starting with a base template that has all callbacks disabled by default. Enable only the specific hook permissions you need in getHookPermissions to minimize the attack surface before deployment.

Does v4 hook development require explicit threat modeling before deployment?

Yes, v4 hook development requires explicit threat modeling to identify risks and establish access-control scaffolding. Building hooks with proven security foundations reduces vulnerability risk for teams shipping auditable checklists.

What is the safest way to implement upgrade patterns for v4 hooks?

The safest way to implement upgrade patterns for v4 hooks is to use predefined, safe upgrade templates provided by a security foundation. This ensures upgrades maintain delta accounting integrity and do not introduce access control vulnerabilities.

Can I use a base hook template to skip access-control scaffolding for v4?

No, you should not skip access-control scaffolding for v4. A base hook template provides a safe starting point with permissions disabled, but you must actively implement risk-aware access controls and threat models for your specific use case.