Loading...
Loading...
Compare original and translation side by side
Runtime Compatibility: This skill usesto collect the acknowledgment described in Scope and Disclaimer before action-oriented deployment guidance. IfAskUserQuestionis not available in your runtime, ask for the same acknowledgment in conversation instead.AskUserQuestion
运行时兼容性: 本技能在提供面向操作的部署指导前,会使用收集范围与免责声明中所述的确认信息。若你的运行环境不支持AskUserQuestion,请在对话中要求用户提供相同的确认信息。AskUserQuestion
DISCLAIMER.mdDISCLAIMER.mdBaseAllowlistCheckerBaseAllowlistChecker| Question | Underlying permissioned ERC-20 | |
|---|---|---|
Which address goes in the | No | Yes — the pool currency is the adapter |
Which does the allowlist checker see as | Yes — the checker is asked about your token | No |
| Which does a wallet or LP hold? | Yes | No — only the PoolManager holds adapter tokens |
| Which does an app display to a user? | Yes | Shown as the |
| Which do you approve through Permit2 for a mint? | Yes — approvals are on the underlying | No |
Uniswap v4 <name>v4<symbol>name()symbol()decimals()Uniswap v4 Permissioned Tokenv4PT18| 问题 | 底层受权限限制的ERC-20 | |
|---|---|---|
哪个地址需填入 | 否 | 是——池内币种为adapter代币 |
白名单检查器将哪个地址视为 | 是——检查器针对你的代币进行验证 | 否 |
| 钱包或流动性提供者(LP)持有哪个地址? | 是 | 否——仅PoolManager持有adapter代币 |
| 应用向用户展示哪个地址? | 是 | 在需要展示时显示为「Uniswap v4 …」虚拟代币 |
| 铸造时需通过Permit2授权哪个地址? | 是——授权针对底层代币 | 否 |
Uniswap v4 <name>v4<symbol>name()symbol()decimals()Uniswap v4 Permissioned Tokenv4PT18| Enforced edge | Revert if you are early |
|---|---|
Adapter allowlisted on your token and holding a non-zero balance → | |
| |
Adapter registered and verified → pool | |
Verified adapter + approved hook + | |
Position manager, router or quoter registered with | bare |
| 强制顺序规则 | 提前调用时触发的回退信息 |
|---|---|
Adapter已在你的代币白名单中 且 持有非零余额 → | |
| |
Adapter已注册并验证 → 调用pool的 | |
已验证的adapter + 已授权的hook + 调用方和接收方具备 | |
Position manager、router或quoter已通过 | 直接 |
| Step | Action |
|---|---|
| 1 | Implement an allowlist checker |
| 2 | Create the Permissions Adapter via the factory |
| 3 | Allowlist the adapter on your token and fund it (1 wei is enough) |
| 4 | Verify the adapter with the factory |
| 5 | Approve the virtual-token contracts (allowed wrappers), then allow the hook on the position manager |
| 6 | Create the pool, then enable swapping on the adapter |
| 7 | Request routing allowlisting with Uniswap Labs |
updateSwappingEnabled(true)| 步骤 | 操作 |
|---|---|
| 1 | 实现白名单检查器 |
| 2 | 通过工厂创建Permissions Adapter |
| 3 | 将adapter加入你的代币白名单,并为其充值(1 wei即可) |
| 4 | 通过工厂验证adapter |
| 5 | 授权虚拟代币合约(允许的wrapper),然后在position manager上授权hook |
| 6 | 创建池,然后在adapter上启用兑换功能 |
| 7 | 向Uniswap Labs申请路由白名单 |
updateSwappingEnabled(true)| Thing | Exact spelling | Trap |
|---|---|---|
| Base contract | | lowercase |
| File holding it | | capital |
| Interface | | lowercase |
| Adapter admin call | | capital |
| Adapter getter | | capital |
| Hook approval call | | singular, on the position manager |
| Its storage mapping | | plural |
| Its event | | plural |
| Flags library | | plural |
| Flag type | | singular |
import {BaseAllowlistChecker} from "@uniswap/v4-periphery/src/hooks/permissionedPools/BaseAllowListChecker.sol";BaseAllowListChecker.sol:BaseAllowlistCheckerpath:Contractforge inspectforge verify-contract| 名称 | 精确拼写 | 注意事项 |
|---|---|---|
| 基础合约 | | 合约名称中的 |
| 所在文件 | | 文件名中的 |
| 接口 | | |
| Adapter管理员调用 | | |
| Adapter获取方法 | | |
| Hook授权调用 | | 单数形式,调用对象为position manager |
| 存储映射 | | 复数形式 |
| 事件 | | 复数形式 |
| 标志库 | | 复数形式 |
| 标志类型 | | 单数形式 |
import {BaseAllowlistChecker} from "@uniswap/v4-periphery/src/hooks/permissionedPools/BaseAllowListChecker.sol";BaseAllowListChecker.sol:BaseAllowlistChecker路径:合约Llforge inspectforge verify-contractcheckAllowlistcheckAllowlistfunction checkAllowlist(address account, address tokenAddress) public view virtual override returns (PermissionFlag)public virtualexternalcheckAllowlistexternal viewsupportsInterfaceIAllowlistCheckerERC165BaseAllowlistCheckerfunction checkAllowlist(address account, address tokenAddress) public view virtual override returns (PermissionFlag)public virtualexternalcheckAllowlistexternal viewsupportsInterfaceIAllowlistCheckerERC165BaseAllowlistCheckercreatePermissionsAdapterInvalidAllowListCheckerIAllowlistCheckersupportsInterfaceupdateAllowListCheckerBaseAllowlistCheckersupportsInterfaceERC165Checker.supportsInterfacesupportsInterface(0x01ffc9a7)truesupportsInterface(0xffffffff)falseERC165super.supportsInterfacetruetype(IAllowlistChecker).interfaceIdsupportsInterfaceIAllowlistCheckercreatePermissionsAdapterInvalidAllowListCheckerupdateAllowListCheckerBaseAllowlistCheckersupportsInterfaceERC165Checker.supportsInterfacesupportsInterface(0x01ffc9a7)truesupportsInterface(0xffffffff)falseERC165super.supportsInterfacetype(IAllowlistChecker).interfaceIdtruePermissionFlagsPermissionFlag| Name | Value | Gates |
|---|---|---|
| | nothing |
| | |
| | |
| | both |
SWAP_ALLOWEDLIQUIDITY_ALLOWEDPermissionFlagPermissionFlagsPermissionFlag| 名称 | 值 | 控制范围 |
|---|---|---|
| | 无任何权限 |
| | hook的 |
| | hook的 |
| | 同时拥有上述两种权限 |
SWAP_ALLOWEDLIQUIDITY_ALLOWEDPermissionFlagupdateAllowedWrapper(address wrapper, bool allowed)onlyOwnerPermissionedPositionManagerUniversalRouter#v2.2V4QuoterMixedRouteQuoterV2allowedWrappers(router)routerwrapToPoolManagerallowedWrappers[msg.sender]PermissionsAdapterFactoryPermissionedHooksUniversalRouter#v2.2updateAllowedWrapper(address wrapper, bool allowed)PermissionedPositionManagerUniversalRouter#v2.2V4QuoterMixedRouteQuoterV2allowedWrappers(router)routerwrapToPoolManagerallowedWrappers[msg.sender]PermissionsAdapterFactoryPermissionedHooksUniversalRouter#v2.2@uniswap/v4-peripherysrc/hooks/permissionedPools/v4-peripheryundefined@uniswap/v4-peripherysrc/hooks/permissionedPools/v4-peripheryundefined
```text
```text
The published guide's import paths are npm-scoped and correct once remapped this way. The guide gives the import lines; the install step and remapping above are what they require.
Details, including the hook-source pin and how to resolve addresses: [Packaging and Sources](./references/packaging-and-sources.md).
---
官方指南的导入路径为npm作用域格式,按上述方式配置映射后即可正确使用。指南提供了导入代码行;上述安装步骤和映射是其必要前提。
详细说明,包括hook源码固定版本和地址解析方法:[打包与源码](./references/packaging-and-sources.md)。
---| Call | Revert | Condition |
|---|---|---|
| | the checker fails the ERC-165 interface check |
| | the adapter's permissioned-token balance is zero |
| | the currency's adapter is not verified yet, so its owner reads as |
pool | | neither currency was created by the factory / a factory-created currency is not verified |
| | no verified side / hook not allowed / caller or recipient lacks |
NoVerifiedAdapterUnauthorizedSwappingDisabledNoVerifiedAdapterUnauthorizedSwappingDisabled| 调用方法 | 回退信息 | 触发条件 |
|---|---|---|
| | 检查器未通过ERC-165接口验证 |
| | Adapter的受权限限制代币余额为零 |
| | 币种对应的adapter尚未验证,因此其所有者地址为 |
pool的 | | 任一币种非工厂创建 / 工厂创建的币种未验证 |
position manager的 | | 无已验证的币种 / hook未授权 / 调用方或接收方无 |
NoVerifiedAdapterUnauthorizedSwappingDisabledNoVerifiedAdapterUnauthorizedSwappingDisabledTransferDisabledunwindPositionallowedWrappersmsgSender()updateAllowedWrapperonlyOwnerOwnable2StepTransferDisabledunwindPositionallowedWrappersmsgSender()updateAllowedWrapperOwnable2SteponlyOwner| Permissionless / issuer-controlled | Coordinated with Uniswap Labs |
|---|---|
| Deploying your allowlist checker | Routing eligibility in the Uniswap interface and API |
| Token-list inclusion |
| Allowlisting the adapter on your token | Token-detail metadata |
| Issuer metadata and KYC URL in the backend configuration |
| |
| Every adapter admin operation | |
|
| 无需许可/发行方可控 | 需与Uniswap Labs协调 |
|---|---|
| 部署你的白名单检查器 | Uniswap界面与API中的路由资格 |
| 代币列表收录 |
| 将adapter加入你的代币白名单 | 代币详情元数据 |
| 后端配置中的发行方元数据与KYC URL |
| |
| 所有adapter管理员操作 | |
|
| Topic | Reference File |
|---|---|
| Contract-by-contract stack, exact-casing inventory, flags, events | Contract Architecture |
| The seven steps in detail, with calls, callers and checks | Issuer Journey |
| The five enforced edges, the revert catalogue, worked scenarios | Enforced Ordering and Reverts |
| Non-transferability, admin force-exit, vetting a candidate wrapper | Trust Model |
| Pinning, remapping, import paths, resolving addresses | Packaging and Sources |
| What is permissionless versus coordinated, the routing request | Coordination Boundary |
| 主题 | 参考文件 |
|---|---|
| 逐合约栈、精确大小写清单、标志、事件 | 合约架构 |
| 七个步骤的详细说明,含调用方法、调用方与检查项 | 发行方流程 |
| 五条强制顺序规则、回退信息目录、场景示例 | 强制顺序与回退信息 |
| 不可转让性、管理员强制退出、候选wrapper审核 | 信任模型 |
| 版本固定、映射配置、导入路径、地址解析 | 打包与源码 |
| 无需许可与需要协调的内容、路由申请 | 协调边界 |
Uniswap/v4-periphery3245c3cb99c48fa1dc2459c3b60abc37d4294abasrc/hooks/permissionedPools/Uniswap/v4-hooks-public7da5210f2c81a700820a6b4f585264233d91f349src/permissioned-pools/PermissionedHooks.solUniswap/mixed-quotersrc/MixedRouteQuoterV2.sol#deployment-addressesUniswap/contractsdeployments/json/<chainId>.jsonlatestUniswap/v4-periphery3245c3cb99c48fa1dc2459c3b60abc37d4294abasrc/hooks/permissionedPools/Uniswap/v4-hooks-public7da5210f2c81a700820a6b4f585264233d91f349src/permissioned-pools/PermissionedHooks.solUniswap/mixed-quotersrc/MixedRouteQuoterV2.sol#deployment-addressesUniswap/contractsdeployments/json/<chainId>.jsonlatest