# Uniswap v4 hook access control

> Uniswap v4 hook access control is an open-source agent skill for security. Guides an agent to audit Uniswap v4 hook callbacks for missing caller and PoolKey checks. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/uniswap-v4-hook-access-control
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** uniswap-v4-hook-access-control
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-02

## About

This skill directs an agent to review a Uniswap v4 singleton hook for one specific weakness: callbacks such as beforeSwap, afterSwap, beforeAddLiquidity and donate that do not confirm the PoolManager is the caller or do not validate the supplied pool key. It lays out a method in which the agent enumerates the hook's callbacks and their permission flags, checks each one for both guards, and traces which internal accounting state can be changed by caller-controlled parameters.

The workflow ends with a proof-of-concept step on a forked chain, where the agent calls an unguarded callback directly with inflated values and compares the result against the same call routed through the PoolManager. It also suggests a formal invariant that hook accounting only advances through PoolManager calls with a registered pool key. The skill frames its output as leads for a fuller verification process rather than final findings, and asks that any finding be checked against existing advisories before reporting.

The skill is written for security specialists and expects a Solidity codebase, the Foundry toolchain (forge, cast, anvil), Slither for static analysis, and optionally halmos for symbolic checking.

## When your agent uses it

> Use when the target integrates a Uniswap v4 singleton hook and you must check each hook callback (beforeSwap, afterSwap, beforeAddLiquidity, donate) for the missing-caller-check class — a callback that fails to require msg.sender is the PoolManager or to validate the supplied PoolKey lets an attacker invoke it directly with forged accounting to mint unbacked tokens or drain the pool.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/uniswap-v4-hook-access-control)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/uniswap-v4-hook-access-control)

## Features

- **Callback caller checks:** Verifies that each hook callback requires the PoolManager as the message sender.
- **PoolKey validation review:** Checks whether callback parameters are tied to pools the hook is authorized for.
- **Hook permission enumeration:** Lists the callbacks a deployed hook exposes by reading its permission bitmap.
- **Accounting state tracing:** Identifies internal balances and supply changed by caller-supplied parameters.
- **Fork-based proof of concept:** Describes a direct-call exploit test on a forked chain with a routed negative control.
- **Invariant suggestion:** Proposes a forge or halmos invariant limiting accounting updates to registered pool calls.

## Good for

- Audit a Uniswap v4 hook for missing PoolManager caller checks
- Check whether beforeSwap or donate can be called directly to mint tokens
- Review a v4 hook's PoolKey validation before a security submission
- Write a fork test showing a direct hook call drains a pool

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/uniswap-v4-hook-access-control` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/uniswap-v4-hook-access-control &&
cp -R "$tmp/.agents/skills/uniswap-v4-hook-access-control" ~/.claude/skills/uniswap-v4-hook-access-control &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/uniswap-v4-hook-access-control` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/uniswap-v4-hook-access-control` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/uniswap-v4-hook-access-control &&
cp -R "$tmp/.agents/skills/uniswap-v4-hook-access-control" ~/.agents/skills/uniswap-v4-hook-access-control &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/uniswap-v4-hook-access-control` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/uniswap-v4-hook-access-control` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/uniswap-v4-hook-access-control &&
cp -R "$tmp/.agents/skills/uniswap-v4-hook-access-control" ~/.cursor/skills/uniswap-v4-hook-access-control &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/uniswap-v4-hook-access-control` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/uniswap-v4-hook-access-control
```

Or copy the folder to `~/.gemini/skills/uniswap-v4-hook-access-control` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/uniswap-v4-hook-access-control`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/uniswap-v4-hook-access-control &&
cp -R "$tmp/.agents/skills/uniswap-v4-hook-access-control" ~/.copilot/skills/uniswap-v4-hook-access-control &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/uniswap-v4-hook-access-control` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/uniswap-v4-hook-access-control` into your agent's skills folder as `uniswap-v4-hook-access-control`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Uniswap v4 hook access control need to run?

It expects a Solidity project with Foundry tooling (forge, cast, anvil), Slither for enumerating callbacks, and optionally halmos for invariant checks.

### Does Uniswap v4 hook access control change any code in my project?

The skill only describes an audit method. It asks the agent to read the hook, run analysis tools, and write a proof-of-concept test, without describing any automatic edits.

### Which vulnerability does Uniswap v4 hook access control focus on?

It focuses on the missing-caller-check class in Uniswap v4 hook callbacks, where an attacker can invoke a callback directly with forged accounting to mint unbacked tokens or drain a pool.

### How do I install Uniswap v4 hook access control in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/uniswap-v4-hook-access-control to use it in all your projects, or to .claude/skills/uniswap-v4-hook-access-control in one project.

### Does Uniswap v4 hook access control run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Uniswap v4 hook access control?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Uniswap v4 hook access control?

The closest alternatives to Uniswap v4 hook access control are V4 security foundations, Defi amm security, Read only reentrancy check, Defi invariant check and Signature validation audit.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [V4 security foundations](https://ai-powered.com/skills/v4-security-foundations): V4 security foundations is an open-source agent skill for developer tools.
- [Defi amm security](https://ai-powered.com/skills/defi-amm-security): Defi amm security is an open-source agent skill for security.
- [Read only reentrancy check](https://ai-powered.com/skills/read-only-reentrancy-check): Read only reentrancy check is an open-source agent skill for security.
- [Defi invariant check](https://ai-powered.com/skills/defi-invariant-check): Defi invariant check is an open-source agent skill for security.
- [Signature validation audit](https://ai-powered.com/skills/signature-validation-audit): Signature validation audit is an open-source agent skill for security.
- [Cross chain bridge audit](https://ai-powered.com/skills/cross-chain-bridge-audit): Cross chain bridge audit is an open-source agent skill for security.
- [Solana audit flow](https://ai-powered.com/skills/solana-audit-flow): Solana audit flow is an open-source agent skill for security.
- [Vulnhunter solana](https://ai-powered.com/skills/vulnhunter-solana): Vulnhunter solana is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/uniswap-v4-hook-access-control
