Uniswap V4 Hook Builder for Openclaw

An automated development assistant for generating production-ready Uniswap V4 hooks, tests, and deployment scripts.

wpank
v0.1.0
Feb 11, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install build-hook

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install build-hook using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Uniswap V4 Hook Builder?

The Uniswap V4 Hook Builder is a specialized skill designed to automate the entire lifecycle of hook development. By leveraging Openclaw Skills, developers can transform high-level requirements into fully functional Solidity code, complete with Foundry tests and valid CREATE2 address mining. This tool bridges the gap between complex DeFi protocol requirements and implementation by handling the technical nuances of Uniswap V4 flags and callback logic.

This skill streamlines the creation of advanced liquidity features such as limit orders, dynamic fees, and oracle integrations. It ensures that generated contracts adhere to security best practices, including reentrancy protection and proper access control, while providing immediate gas estimates and deployment-ready artifacts.

Uniswap V4 Hook Builder Use Cases

  • Building limit order hooks that execute at specific price ticks.
  • Creating dynamic fee hooks that adjust based on market volatility or volume.
  • Developing TWAMM (Time-Weighted Average Market Maker) hooks for smoothed execution.
  • Generating boilerplate for oracle-integrated hooks to fetch external data.
  • Automating the mining of CREATE2 addresses to satisfy V4 flag requirements.

How Uniswap V4 Hook Builder Works

  1. The agent analyzes the user prompt to identify required hook behaviors, callbacks (like beforeSwap or afterSwap), and target chains.
  2. It delegates the complex generation tasks to a specialized subagent that understands the Uniswap V4 architecture and flag bitmasks.
  3. The system generates a Solidity contract extending the BaseHook standard with comprehensive NatSpec documentation.
  4. A CREATE2 salt is mined to produce an address that encodes the specific flags required by the V4 PoolManager.
  5. Detailed Foundry test suites are created to verify unit logic, integration behavior, and gas consumption.
  6. The final output includes deployment scripts and an architectural summary for the developer.

Uniswap V4 Hook Builder Setup

To get started with this skill in your environment, ensure you have Foundry installed for testing and compilation. Openclaw Skills relies on the following setup:

# Install Foundry (forge)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Install necessary Uniswap V4 dependencies
npm install @uniswap/v4-core @uniswap/v4-periphery

Uniswap V4 Hook Builder Data Schema & Taxonomy

The skill organizes generated files within your project structure as follows:

Component File Path Description
Contract src/hooks/[HookName].sol Main Solidity contract with hook logic and flags.
Tests test/hooks/[HookName].t.sol Foundry test suite covering callbacks and edge cases.
Script script/Deploy[HookName].s.sol Deployment script for on-chain execution.
Metadata Console Summary Includes flag bitmasks, gas snapshots, and mined salt.

Uniswap V4 Hook Builder Advanced Features

  • Automated CREATE2 mining to ensure address compliance with V4 flag bits.
  • Integrated gas snapshotting to measure per-callback overhead directly from tests.
  • Intelligent callback mapping that validates flag combinations against V4 core rules.
  • Support for multiple EVM chains including Ethereum mainnet and Sepolia testnets.
  • Production-quality code generation using Solidity 0.8.26 standards.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*