permissioned-pools-deployer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Permissioned Pools Deployer

权限池部署工具

Guided, step-by-step execution of the on-chain setup sequence for a Uniswap v4 Permissioned Pool, starting from the JSON configuration
permissioned-pools-configurator
produces. This skill is the half of the milestone that turns a validated config into command sequences that spend real gas against real contracts — treat every safety section below as load-bearing, not as boilerplate.
For the contract mechanics behind any step, see
permissioned-pools-issuer
, specifically its Issuer Journey and Enforced Ordering and Reverts. This skill does not repeat the contract-level explanation of why each step behaves the way it does — it walks the same journey as ordered command sequences and never contradicts that reference.
Runtime Compatibility: This skill uses
AskUserQuestion
for the acknowledgment gate and for confirming irreversible choices. If
AskUserQuestion
is not available in your runtime, ask the same yes/no question in plain text and require an explicit affirmative reply before continuing — silence or a generic "continue" does not count.
本工具将逐步引导您完成Uniswap v4权限池的链上设置流程,流程起点为permissioned-pools-configurator生成的JSON配置文件。本技能是将验证后的配置转化为可消耗真实Gas、调用真实合约的命令序列的核心环节——请务必严格遵守以下所有安全说明,切勿将其视为无关紧要的模板内容。
如需了解各步骤背后的合约机制,请查看
permissioned-pools-issuer
,尤其是其中的发行方流程强制顺序与回滚规则。本技能不会重复解释各步骤设计逻辑的原因——仅按指定命令序列引导流程,且内容与上述参考文档完全一致。
运行时兼容性:本技能使用
AskUserQuestion
实现确认门槛,并用于确认不可逆操作选择。若您的运行环境不支持
AskUserQuestion
,请以纯文本形式询问相同的是非问题,且必须在得到用户明确的肯定答复后才可继续——沉默或通用的「继续」回复均不视为有效确认。

Scope and Disclaimer

适用范围与免责声明

This is educational deployment guidance, not a compliance review, and not a substitute for your own review of every command before you run it.
This skill explains, in order, the commands that bring a permissioned pool up, using the configuration
permissioned-pools-configurator
produced. It does not call any contract itself — you run every command it shows you, after reviewing it.
You must:
  1. Review every configuration and every command carefully before running anything. AI-generated command sequences may contain errors.
  2. Verify every address — this skill contains no deployment addresses and resolves none for you; see Address Resolution.
  3. Test on a testnet first. Run the entire sequence on Sepolia (or another testnet with the permissioned-pools contracts deployed) before touching mainnet.
  4. Have your own auditors review any contract you deploy — most importantly your allowlist checker, which this skill can show you a skeleton for but does not audit.
  5. Treat this as contract mechanics only. This skill does not constitute legal, financial, investment, or tax advice, and it is not a compliance review of your token, your allowlist, your KYC or AML program, or your configuration.
  6. Read the repo's usage guidelines. The repo root
    DISCLAIMER.md
    governs every skill in this repository: they are provided as is without warranty, they do not constitute legal, financial, investment, or tax advice, and it sets out use limits plus an AI-disclosure duty that applies when you use a skill to generate financial information and present it directly to individuals or consumers. Point the user to it.
本内容为部署教育指导,而非合规审查,也不能替代您在执行命令前对每一条命令的自主审核。
本技能将按顺序解释基于permissioned-pools-configurator配置文件启动权限池所需的命令。技能本身不会直接调用任何合约——您需自行执行展示的命令,且执行前必须完成审核。
您必须做到:
  1. 仔细审核每一项配置和每一条命令后再执行任何操作。AI生成的命令序列可能存在错误。
  2. 验证每一个地址——本技能不包含任何部署地址,也不会为您解析地址;请查看地址解析
  3. 先在测试网进行测试。在接触主网前,先在Sepolia(或其他已部署权限池合约的测试网)完整运行一遍流程。
  4. 请您的审计人员审核所有部署的合约——尤其重要的是白名单检查器,本技能仅能为您展示其框架,但不会提供审计服务。
  5. 仅将本内容视为合约机制说明。本内容不构成法律、财务、投资或税务建议,也不是对您的代币、白名单、KYC/AML程序或配置的合规审查。
  6. 阅读仓库的使用指南。仓库根目录的
    DISCLAIMER.md
    适用于本仓库中的所有技能:内容按「现状」提供,不提供任何担保,不构成法律、财务、投资或税务建议,同时规定了使用限制以及当您使用技能生成财务信息并直接展示给个人或消费者时的AI披露义务。请引导用户查看该文件。

The acknowledgment gate

确认门槛

Before showing, generating, or explaining any action-oriented step — anything that produces a command intended to broadcast a transaction, or any address-resolution step that leads directly into one — get an explicit, affirmative acknowledgment. This gate must never be satisfiable implicitly.
Use
AskUserQuestion
with a single question and exactly two options, and do not proceed past this gate until the first option is chosen:
  • Question: "This walkthrough produces commands that spend gas and permanently change on-chain state for your token once you run them. Do you acknowledge the six points above and want to continue?"
  • Option A — "Yes, I have reviewed the points above and want to continue." → proceed to the preflight checks.
  • Option B — "No, stop here." → end the walkthrough immediately. Do not display, generate, or explain any command below this point.
Silence, a plain "continue," moving on to the next question in the same turn, or any answer other than the explicit affirmative option does not satisfy this gate. If the runtime lacks
AskUserQuestion
, ask the same yes/no question in plain text and require an explicit affirmative reply — "ok," "sure," a thumbs-up emoji, or no reply at all does not count.
Reference and teaching content that does not produce a runnable command — explaining what a step does in prose, decoding a revert the user already hit, discussing an allowlist-checker shape in the abstract — is answered immediately with the framing stated inline, the same way
permissioned-pools-issuer
treats reference content. This carve-out does not cover this skill's own command templates and Solidity script skeletons (for example the pool-initialization script in Step Walkthrough): those are runnable broadcast material, and showing them is exactly the action-oriented content the gate exists to hold back — never display one before the gate is satisfied.

在展示、生成或解释任何面向操作的步骤之前——即任何会生成可广播交易命令的步骤,或直接导向此类命令的地址解析步骤——必须获得用户明确的肯定确认。此门槛绝不能通过隐含方式满足。
使用
AskUserQuestion
提出单一问题并提供两个明确选项,且只有当用户选择第一个选项时才可继续:
  • 问题:「本指南生成的命令会消耗Gas,且一旦执行将永久改变您的代币链上状态。您是否已确认上述六点并希望继续?」
  • 选项A——「是的,我已审核上述内容并希望继续。」 → 进入预检检查环节。
  • 选项B——「不,在此停止。」 → 立即终止指南。不得展示、生成或解释此门槛以下的任何命令。
沉默、单纯的「继续」回复、在同一轮对话中跳至下一个问题,或任何非明确肯定的回复均满足此门槛要求。若运行环境不支持
AskUserQuestion
,请以纯文本形式询问相同的是非问题,并要求用户给出明确的肯定答复——「好的」「没问题」、点赞表情或无回复均不视为有效确认。
不会生成可运行命令的参考和教学内容——比如以文字解释步骤作用、解码用户已遇到的回滚信息、抽象讨论白名单检查器的结构——可直接以内嵌框架进行回复,与
permissioned-pools-issuer
处理参考内容的方式一致。但本例外适用于本技能自身的命令模板和Solidity脚本框架(例如步骤详解中的池初始化脚本):这些属于可广播的运行内容,展示此类内容正是设置确认门槛的目的——在门槛满足前绝不能展示。

Input Validation Rules

输入验证规则

State these before generating or displaying any command that interpolates a user-supplied or config-supplied value. Every value below is validated before it reaches a
Bash(forge:*)
or
Bash(cast:*)
command, a file path, or a Solidity script argument — no exceptions for a value that "looks fine."
  • Ethereum addresses — MUST match
    ^0x[a-fA-F0-9]{40}$
    . Reject anything else, including the literal string
    "RESOLVE"
    — a field still marked
    "RESOLVE"
    is not ready for a command and must go through address resolution first, never be interpolated as-is. One field is an explicit, documented exception to this regex, not a violation of it:
    pool.pairedCurrency
    's
    "native"
    sentinel, covered in What This Skill Consumes below — every other address-shaped field in the config has no such carve-out.
  • Chain ID — MUST be a positive integer (
    ^[1-9][0-9]*$
    ). Ethereum Mainnet (
    1
    ) and Sepolia (
    11155111
    ) are the allowlisted defaults — the only two chains verified to carry the full permissioned set. Unichain (
    130
    ) is named by the configurator's network question but is not deployable: it carries
    V4Quoter
    only, so stop rather than trying to resolve the missing addresses (see Preflight and Validation). Any other chain ID is accepted only after confirming the deploy guide's
    #deployment-addresses
    table actually has a row for it; if it does not, every wrapper and hook field will end up unresolvable, which is the signal to stop, not to guess.
  • Numeric fields (
    verificationDepositAmount
    ,
    pool.feeTier
    ,
    pool.tickSpacing
    ,
    pool.startingPriceRatio
    ) — MUST match
    ^[0-9]+$
    for integer-only fields or
    ^[0-9]+(\.[0-9]+)?$
    for the starting price ratio, and MUST be strictly greater than zero.
  • Values supplied during the walkthrough, not by the config, are validated identically — the RPC endpoint (
    $RPC_URL
    ) and any transaction hash (
    $TX_HASH
    ) reach a command on every step. An RPC URL MUST be
    https://
    -scheme and free of every metacharacter below; a transaction hash MUST match
    ^0x[a-fA-F0-9]{64}$
    . "It came from the user, not the config" is not an exemption.
  • Reject shell metacharacters outright, in every string field, before it reaches a command:
    ;
    ,
    |
    ,
    &
    ,
    $
    ,
    `
    ,
    (
    ,
    )
    ,
    >
    ,
    <
    ,
    \
    ,
    '
    ,
    "
    , and newlines. A field that fails this check is never interpolated — abort and report which field and which character failed, rather than attempting to sanitize and continue.
  • Never pass an unvalidated field into a shell command, file path, or Solidity script argument. Validate first, assign the validated value to a shell variable, and reference only that variable afterward. Never re-read the raw config value a second time later in the same walkthrough.
Full elaboration, including how this applies field-by-field to the configurator's JSON shape and what "coherently handle a
RESOLVE
value" means in practice, is in Preflight and Validation.

在生成或展示任何插入用户提供或配置提供值的命令前,请说明以下规则。以下所有值必须在传入
Bash(forge:*)
Bash(cast:*)
命令、文件路径或Solidity脚本参数之前完成验证——任何「看起来没问题」的值都不能例外。
  • 以太坊地址——必须匹配正则
    ^0x[a-fA-F0-9]{40}$
    。拒绝任何不符合要求的值,包括字面字符串
    "RESOLVE"
    ——标记为
    "RESOLVE"
    的字段尚未准备好用于命令,必须先完成地址解析,绝不能直接插入使用。有一个字段是此正则的明确、有文档记录的例外,而非违规:
    pool.pairedCurrency
    中的
    "native"
    标记,将在下文本技能的输入内容中说明——配置中所有其他地址格式的字段均无此例外。
  • 链ID——必须为正整数(
    ^[1-9][0-9]*$
    )。以太坊主网(
    1
    )和Sepolia(
    11155111
    )是默认允许的链——仅这两条链已验证支持完整的权限池功能。Unichain(
    130
    )虽在配置工具的网络问题中被提及,但不可部署:该链仅支持
    V4Quoter
    ,因此应终止流程而非尝试解析缺失的地址(详见预检与验证)。其他任何链ID仅在部署指南的
    #deployment-addresses
    表格中存在对应行时才可接受;若不存在对应行,所有包装器和钩子字段将无法解析,此时应终止流程而非猜测值。
  • 数值字段
    verificationDepositAmount
    pool.feeTier
    pool.tickSpacing
    pool.startingPriceRatio
    )——仅接受整数的字段必须匹配
    ^[0-9]+$
    ,起始价格比率字段必须匹配
    ^[0-9]+(\.[0-9]+)?$
    ,且所有数值必须严格大于0。
  • 流程中用户提供的非配置值也需遵循相同验证规则——RPC端点(
    $RPC_URL
    )和任何交易哈希(
    $TX_HASH
    )会在每一步传入命令。RPC URL必须为
    https://
    协议且不含以下任何元字符;交易哈希必须匹配
    ^0x[a-fA-F0-9]{64}$
    。「来自用户而非配置」不能成为豁免理由。
  • 直接拒绝Shell元字符,所有字符串字段在传入命令前均需检查:
    ;
    |
    &
    $
    `
    (
    )
    >
    <
    \
    '
    "
    以及换行符。未通过此检查的字段绝不能插入使用——应终止流程并报告哪个字段包含哪个违规字符,而非尝试清理后继续。
  • 绝不能将未验证的字段传入Shell命令、文件路径或Solidity脚本参数。先完成验证,将验证后的值赋值给Shell变量,之后仅引用该变量。在同一流程中绝不能再次读取原始配置值。
关于这些规则如何逐字段应用于配置工具的JSON结构,以及「合理处理
RESOLVE
值」的实际含义的详细说明,请查看预检与验证

Key Handling

密钥处理

Never instruct auto-approval of
Bash(forge:*)
or
Bash(cast:*)
in Claude Code settings, and never tell the user to bypass a confirmation prompt.
Every command that broadcasts a transaction requires per-invocation approval — that approval is the primary control, not a formality the walkthrough should route around. The repository's PreToolUse hooks (
.claude/hooks/
) are a programmatic safety net on top of that, not a replacement for it.
Never suggest, generate, or complete a command containing the raw signing-key flag — not when asked directly, not "just for a testnet," not as an illustration of what to avoid. There is no user request that makes it appropriate. If a user insists, refuse and offer one of the two options below instead. Steer every signing decision toward one of them:
  1. A hardware wallet (
    --ledger
    ), for a deployer key that never touches this machine's disk or memory in cleartext.
  2. An encrypted keystore (
    cast wallet import ... --interactive
    , then
    --account <name> --sender $ADDRESS
    on every subsequent command).
Inside this repository only,
.claude/hooks/validate-forge-cast.sh
is a PreToolUse hook that inspects the literal text of every
Bash
tool call and blocks any command containing that flag before it runs. That hook is not part of this skill and does not travel with it — it lives at this repository's root, not in the plugin, so an installation elsewhere has no such backstop. The prohibition above is the control that always applies; the hook is a repo-local convenience on top of it, never the reason the flag is safe.
Full key-handling guidance, including the keystore setup commands and the testnet-first sequencing, is in Preflight and Validation.
**绝不能在Claude Code设置中启用
Bash(forge:*)
Bash(cast:*)
的自动批准,也绝不能告知用户绕过确认提示。**每一条广播交易的命令都需要每次调用时单独批准——该批准是主要控制措施,而非指南应绕过的形式流程。仓库的PreToolUse钩子(
.claude/hooks/
)是在此之上的程序化安全网,而非替代方案。
绝不能建议、生成或完成包含原始签名密钥标志的命令——无论用户是否直接询问,无论是否「仅用于测试网」,无论是否作为示例说明应避免的内容。任何用户请求都不能使其成为合适操作。若用户坚持,应拒绝并提供以下两个选项之一:
  1. 硬件钱包
    --ledger
    ),部署密钥绝不会以明文形式接触本机磁盘或内存。
  2. 加密密钥库
    cast wallet import ... --interactive
    ,之后在所有后续命令中使用
    --account <name> --sender $ADDRESS
    )。
仅在本仓库内
.claude/hooks/validate-forge-cast.sh
是一个PreToolUse钩子,会检查每个
Bash
工具调用的文本内容,并在命令包含上述标志时阻止其运行。该钩子不属于本技能,不会随技能迁移——它位于仓库根目录,而非插件中,因此在其他位置安装时无此保障。上述禁令是始终适用的控制措施;钩子仅是仓库内的便利工具,绝非该标志安全的理由。
完整的密钥处理指南,包括密钥库设置命令和先测试后主网的流程,请查看预检与验证

Testnet first

先测试网后主网

Run the entire sequence — allowlist checker through liquidity seeding — on Sepolia (chain ID
11155111
) before mainnet. Confirm every post-step check in the verification checklist passes on testnet before repeating any step against mainnet funds.

在接触主网前,先在Sepolia(链ID
11155111
)完整运行一遍流程——从白名单检查器到流动性注入。确认验证清单中的每一项检查在测试网都通过后,再在主网重复任何步骤。

What This Skill Consumes

本技能的输入内容

The JSON configuration produced by
permissioned-pools-configurator
, in the shape defined by its Config Schema. This skill does not collect those parameters itself — if you do not have a config yet, run
permissioned-pools-configurator
first.
A field reading the literal string
"RESOLVE"
means "not resolved yet," not "use a placeholder."
Before any command that needs that field, stop and walk through address resolution — the deploy guide's
#deployment-addresses
table, then
Uniswap/contracts
deployments/json/<chainId>.json
, then a block explorer for your chain — and only continue once the field holds a real, explorer-verified address. Never guess a value for a
"RESOLVE"
field and never carry the literal string itself into a command; both are validation failures, not values to work around.
pool.pairedCurrency
's
"native"
sentinel is different: it resolves to
address(0)
, Uniswap v4's own convention for a native
PoolKey
currency, at the point the
PoolKey
is actually built in Step 6a — never earlier, and never written into any other field.

permissioned-pools-configurator
生成的JSON配置文件,其结构符合配置Schema的定义。本技能不会自行收集这些参数——若您尚未获得配置文件,请先运行
permissioned-pools-configurator
**字段值为字面字符串
"RESOLVE"
表示「尚未解析」,而非「使用占位符」。**在任何需要该字段的命令执行前,应终止流程并引导用户完成地址解析——先查看部署指南的
#deployment-addresses
表格,再查看
Uniswap/contracts
deployments/json/<chainId>.json
,最后查看对应链的区块浏览器——仅当字段值为真实、经浏览器验证的地址时才可继续。绝不能为
"RESOLVE"
字段猜测值,也绝不能将字面字符串直接传入命令;这两种情况均属于验证失败,而非可变通处理的值。
pool.pairedCurrency
中的
"native"
标记则不同:它会在步骤6a中构建
PoolKey
时解析为
address(0)
,这是Uniswap v4对原生
PoolKey
货币的约定——绝不能提前解析,也绝不能写入其他字段。

The Deployment Journey

部署流程

The published guide's seven steps, in the order it recommends. Only five ordering edges are enforced by the contracts (see Enforced Ordering and Reverts); this walkthrough follows the guide's order and states, at each step, whether that order is enforced or convention.
StepCovered whereSummary
1Preflight and ValidationConfirm or deploy the allowlist checker
2Step Walkthrough
createPermissionsAdapter
3Step WalkthroughAllowlist the adapter on your token, approve,
depositForVerification
4Step Walkthrough
verifyPermissionsAdapter
5Step WalkthroughThe four
updateAllowedWrapper
registrations, then
setAllowedHook
6Step WalkthroughPool
initialize
,
updateSwappingEnabled
, liquidity seeding
7Step WalkthroughThe routing-allowlist request
Every step in Step Walkthrough names its precondition and, where the contracts enforce one, the exact revert selector you get if you are early — matching Enforced Ordering and Reverts selector-for-selector. Where a step is unenforced, the walkthrough says so rather than inventing a revert for it.

已发布指南中的七个步骤,按指南推荐的顺序执行。合约仅强制要求五个顺序约束(详见强制顺序与回滚规则);本指南遵循指南的顺序,并在每个步骤说明该顺序是强制要求还是常规约定。
步骤对应文档位置摘要
1预检与验证确认或部署白名单检查器
2步骤详解调用
createPermissionsAdapter
3步骤详解为适配器设置代币白名单、授权、调用
depositForVerification
4步骤详解调用
verifyPermissionsAdapter
5步骤详解完成四次
updateAllowedWrapper
注册,再调用
setAllowedHook
6步骤详解调用池
initialize
updateSwappingEnabled
、注入流动性
7步骤详解提交路由白名单申请
步骤详解中的每个步骤都会说明前置条件,若合约强制要求顺序,则会说明提前执行时触发的具体回滚选择器——与强制顺序与回滚规则中的选择器完全匹配。若步骤无强制顺序约束,指南会明确说明,而非虚构回滚规则。

Post-Deployment Verification

部署后验证

After the sequence completes (or after any individual step, to confirm it landed), run the read-only checks in Post-Setup Verification Checklist. Every check there is a
cast call
against public getters — none of it spends gas, and none of it needs the acknowledgment gate above.

流程完成后(或在任何单个步骤完成后,用于确认操作成功),运行部署后验证清单中的只读检查。所有检查均为针对公共 getter 的
cast call
——不会消耗Gas,也无需经过上述确认门槛。

Notes for Implementers of This Flow

本流程实现者注意事项

  • The acknowledgment gate is once per session, not once per step. Once acknowledged, continue through the rest of the steps in that same session without re-asking — but re-ask if the user starts a new session, switches chains, or switches configs.
  • Never hardcode a contract address. Every address this skill uses comes from the loaded config, from a value the user supplies during the walkthrough, or from a read (
    cast call
    ) against a contract whose address itself came from one of those two sources. See Preflight and Validation for why this skill ships no address table.
  • Decode an unexpected revert by call site, not by name. Three selectors in this journey (
    NoVerifiedAdapter
    ,
    Unauthorized
    ,
    SwappingDisabled
    ) are declared more than once across different contracts with different meanings — see Enforced Ordering and Reverts.
  • This skill does not fetch RPC state on its own initiative. Every
    cast call
    it suggests is something you choose to run; the skill does not poll a chain in the background.
  • 确认门槛仅需在每次会话中触发一次,而非每个步骤触发一次。一旦获得确认,在同一会话中可继续后续步骤无需重复询问——但当用户开启新会话、切换链或切换配置时,需重新询问。
  • 绝不能硬编码合约地址。本技能使用的所有地址均来自加载的配置、用户在流程中提供的值,或对地址来自上述两种来源的合约调用
    cast call
    读取的结果。查看预检与验证了解本技能未附带地址表的原因。
  • 按调用位置而非名称解码意外回滚。本流程中有三个选择器(
    NoVerifiedAdapter
    Unauthorized
    SwappingDisabled
    )在不同合约中多次声明且含义不同——详见强制顺序与回滚规则
  • 本技能不会主动获取RPC状态。所有建议的
    cast call
    均由您选择执行;技能不会在后台轮询链状态。