← 返回 Skills 市场
openclaw-consensus-bot

Uniswap V4

作者 openclaw-consensus-bot · GitHub ↗ · v2.0.4
cross-platform ⚠ suspicious
1544
总下载
1
收藏
4
当前安装
5
版本数
在 OpenClaw 中安装
/install uniswap-v4
功能描述
Swap tokens and read pool state on Uniswap V4 (Base, Ethereum). Use when the agent needs to: (1) swap ERC20 tokens or ETH via Uniswap V4, (2) get pool info (price, tick, liquidity, fees), (3) find the best pool for a token pair, (4) quote expected swap output via the on-chain V4Quoter, (5) set up Permit2 approvals for the Universal Router, or (6) execute exact-input swaps with proper slippage protection. Supports Base and Ethereum mainnet, plus Base Sepolia testnet. TypeScript with strict types. Write operations need a private key via env var.
安全使用建议
This repo appears to implement the advertised Uniswap V4 functionality and only needs a PRIVATE_KEY for transactions, but review and a few precautions are necessary before using with real funds: - Prefer the TypeScript entrypoints (npx tsx src/pool-info.ts, src/quote.ts, src/approve.ts, src/swap.ts) rather than the included shell wrappers. The SKILL.md emphasizes TypeScript usage; many shell scripts are legacy/auxiliary and rely on external tools. - Inspect src/approve.ts and src/swap.ts to confirm they do not pass PRIVATE_KEY on the command line to external processes. If you must use the shell scripts, note they call 'cast' with --private-key "$PRIVATE_KEY" which can expose the key via process listings; avoid running those scripts with real keys. - Use a secure signer when possible (hardware wallet, remote signer, or ephemeral key) rather than a long-lived raw private key in your shell environment. - Supply your own trusted RPC endpoint (Alchemy/Alchemy-like) rather than public endpoints for sensitive operations; the repo notes public defaults but recommends paid providers for important work. - If you plan to install into an automated agent, run the repository's security scan (node scripts/security-scan.mjs) and run unit/integration tests in a safe environment first. Confirm which script the agent will invoke (TypeScript vs. shell) and ensure the agent runtime has only the minimal required binaries. If you want, I can: (1) inspect src/swap.ts and src/approve.ts specifically and report whether they risk leaking PRIVATE_KEY, or (2) produce a short checklist to safely run swaps (minimize key exposure, RPC selection, dry-run steps).
功能分析
Type: OpenClaw Skill Name: uniswap-v4 Version: 2.0.4 The skill bundle demonstrates a strong commitment to security, explicitly addressing numerous vulnerabilities (PT-001, PT-002, PT-003, C-01, C-02, C-03, C-04, H-01, M-01, M-04, M-05) as detailed in `CHANGELOG.md` and `README.md`. The TypeScript code uses `ethers.js` for secure blockchain interactions, `BigInt` for arbitrary-precision arithmetic, and strict input validation via regex to prevent injection and overflow. Private keys are strictly enforced via environment variables, with explicit rejection of CLI arguments to prevent exposure (e.g., `src/lib/cli.ts`, `src/lib/validation.ts`, `scripts/approve.sh`, `scripts/swap.sh`). A dedicated `scripts/security-scan.mjs` checks for `eval`/`exec` and hardcoded secrets, and a comprehensive test suite (including `tests/unit/no-secret-leak.test.ts` and injection tests in `tests/smoke.sh`) verifies these security controls. No evidence of intentional harmful behavior, data exfiltration, or unauthorized actions was found; all operations align with the stated purpose of Uniswap V4 token swaps and pool state reads.
能力评估
Purpose & Capability
The code and SKILL.md align with the stated purpose (reading pool state, quoting, Permit2 approvals, and executing swaps). Requested credentials are proportional (PRIVATE_KEY only for write ops). However, the repository includes multiple auxiliary shell/Python scripts that require external tools (cast/foundry, python3, jq) which are not declared in the top-level 'required binaries' or metadata — this mismatch is unexpected but plausibly explained by providing legacy/auxiliary scripts alongside the TypeScript CLI.
Instruction Scope
SKILL.md instructs using the TypeScript entrypoints (npx tsx src/*.ts) and clearly limits private-key usage to env var for write operations. Nonetheless several included shell scripts (e.g., scripts/approve.sh, scripts/swap.sh, scripts/v4_read.py wrappers) invoke external binaries (cast) and pass the PRIVATE_KEY as a CLI argument to those binaries (e.g., --private-key "$PRIVATE_KEY"). Passing private keys as process arguments can expose them in process listings on the host. The presence of both modern TypeScript scripts and older shell/Python wrappers creates ambiguity about which code the agent will actually run; the shell wrappers also rely on default public RPC endpoints. The skill's runtime instructions do not clearly document this duality, which increases risk of accidental key exposure.
Install Mechanism
There is no remote download/install step in the skill metadata (instruction-only install); package.json and package-lock.json indicate normal npm dependencies (ethers, dev tooling). No arbitrary remote archives or shorteners are used. This is low risk from an install-mechanism perspective.
Credentials
The only sensitive environment variable used is PRIVATE_KEY for write operations, which is appropriate for a swap/transaction skill. RPC URL env vars are optional. That said, some scripts implicitly assume availability of foundry/cast and pass PRIVATE_KEY to cast as a CLI argument (see instruction_scope). The skill metadata declares node as required but does not declare cast/python/jq as required even though several scripts require them.
Persistence & Privilege
The skill does not request elevated or persistent platform privileges; always:false and the skill doesn't modify other skills or system-wide config. Autonomous invocation is enabled (normal for skills) but not combined with other high-risk signals.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install uniswap-v4
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /uniswap-v4 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.4
Security: add CI regression test ensuring PRIVATE_KEY never printed; docs: treat stdout/stderr as public logs.
v2.0.3
Safety: preflight contract bytecode checks (wrong-RPC guard); correct address reference table; add assertHasBytecode unit tests.
v2.0.2
RPC provider: ethers v6 staticNetwork; bump vitest to v3; add provider unit tests
v2.0.1
Patch: fix --recipient routing, JSON exit codes, and reject --private-key=value.
v2.0.0
Full TypeScript rewrite. 85 unit tests. CI/CD pipeline. Strict types. Fork/testnet/mainnet test tiers. BigInt arithmetic. RCE eliminated.
元数据
Slug uniswap-v4
版本 2.0.4
许可证
累计安装 4
当前安装数 4
历史版本数 5
常见问题

Uniswap V4 是什么?

Swap tokens and read pool state on Uniswap V4 (Base, Ethereum). Use when the agent needs to: (1) swap ERC20 tokens or ETH via Uniswap V4, (2) get pool info (price, tick, liquidity, fees), (3) find the best pool for a token pair, (4) quote expected swap output via the on-chain V4Quoter, (5) set up Permit2 approvals for the Universal Router, or (6) execute exact-input swaps with proper slippage protection. Supports Base and Ethereum mainnet, plus Base Sepolia testnet. TypeScript with strict types. Write operations need a private key via env var. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1544 次。

如何安装 Uniswap V4?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install uniswap-v4」即可一键安装,无需额外配置。

Uniswap V4 是免费的吗?

是的,Uniswap V4 完全免费(开源免费),可自由下载、安装和使用。

Uniswap V4 支持哪些平台?

Uniswap V4 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Uniswap V4?

由 openclaw-consensus-bot(@openclaw-consensus-bot)开发并维护,当前版本 v2.0.4。

💬 留言讨论