Skip to content
Back to skills

2519 Uniswap Hooks 623506dd

ASecurity

AI-powered, security-first assistance for creating Uniswap v4 hooks.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
devopsbashtestinggitsecurity

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2519-uniswap-hooks_623506dd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2519 Uniswap Hooks 623506dd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2519 Uniswap Hooks 623506dd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2519-uniswap-hooks-623506dd/badge)](https://www.skillsdirectory.com/skills/tools-only-2519-uniswap-hooks-623506dd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
title: Uniswap Hooks
order: 3
---

# Uniswap Hooks

AI-powered, security-first assistance for creating Uniswap v4 hooks.

## Installation

```bash
/plugin install uniswap-hooks
```

## Skills

| Skill                                                        | Description                                  | Invocation                 |
| ------------------------------------------------------------ | -------------------------------------------- | -------------------------- |
| [v4 Security Foundations](../skills/v4-security-foundations) | Security-first guide for V4 hook development | `/v4-security-foundations` |

## Hook Callbacks

Hooks are smart contracts that intercept and modify pool actions at specific points:

| Callback                | When Called           | Use Case                  |
| ----------------------- | --------------------- | ------------------------- |
| `beforeInitialize`      | Before pool creation  | Validate pool parameters  |
| `afterInitialize`       | After pool creation   | Set up hook state         |
| `beforeAddLiquidity`    | Before LP deposit     | Custom fee logic          |
| `afterAddLiquidity`     | After LP deposit      | Update rewards            |
| `beforeRemoveLiquidity` | Before LP withdrawal  | Lock periods              |
| `afterRemoveLiquidity`  | After LP withdrawal   | Distribute rewards        |
| `beforeSwap`            | Before swap execution | Price oracles, routing    |
| `afterSwap`             | After swap execution  | MEV protection, analytics |
| `beforeDonate`          | Before donation       | Access control            |
| `afterDonate`           | After donation        | Track donations           |

## Hook Flags

Hooks declare which callbacks they implement via a permissions struct. The hook address must encode which callbacks are enabled in its last 14 bits. Use the hook miner to find valid addresses during deployment.

```solidity
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
    return Hooks.Permissions({
        beforeInitialize: false,
        afterInitialize: true,
        beforeSwap: true,
        afterSwap: true,
        // ... remaining flags
    });
}
```

## Development Guidelines

- **Address requirements**: v4 hooks must have specific address patterns where the last 14 bits encode enabled callbacks
- **State management**: Use transient storage for temporary data; consider gas costs for persistent state
- **Security**: Validate all inputs, guard against reentrancy, consider MEV implications
- **Testing**: Test edge cases with extreme tick ranges

## Related

- [Plugins Overview](/plugins/) - All available plugins
- [Skills](/skills/) - All available skills
- [Uniswap v4 Core](https://github.com/Uniswap/v4-core)
- [v4 Periphery](https://github.com/Uniswap/v4-periphery)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…