微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

Clawlett

Clawlett · v0.4.1
安全 A 级 作者 0xardi 公开目录收录
1.1k 下载 2 安装 3.1k 收藏 3 浏览

简介

Clawlett

原始描述

Secure autonomous token swaps on Base Mainnet via a Gnosis Safe using MEV-protected CoW Protocol, with token approval, ETH wrapping, scam detection, and uniq...

通过你的 Agent 添加

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/clawlett-45079/
Codex CLI~/.codex/skills/clawlett-45079/
DeepSeek Harness~/.agents/skills/clawlett-45079/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Clawlett是专为Base Mainnet设计的链上交易Agent技能,采用Safe+Zodiac Roles架构实现资金自托管。用户通过自然语言指令即可完成:

  1. 代币兑换:默认使用KyberSwap聚合器寻找最优路由(支持原生ETH),可选CoW Protocol享受MEV保护(自动包裹ETH至WETH),费率分别为0.1%和0.5%
  2. Trenches生态:创建代币、买卖交易、趋势发现,支持BID/ETH双基础代币对
  3. 资产管理:查询余额、WETH包裹/解包裹、代币授权

执行流程严守"先报价后执行"原则:所有链上操作默认仅展示报价详情,必须获得用户明确确认(如"execute"/"do it"指令)后方可执行,杜绝误操作。

显著优点

安全架构领先:资金完全由Gnosis Safe托管,Agent钱包仅持有Gas费;Zodiac Roles权限模块严格限制操作范围——仅能调用白名单合约、仅能授权至指定Router、禁止任意转账,实现"可交易但不可挪用"的权限最小化。

交易引擎双保险:KyberSwap聚合多DEX流动性寻找最优价格,CoW Protocol采用批量拍卖机制抵御MEV攻击,用户可按场景灵活选择。

反诈骗体系完善:14个主流代币(ETH/WETH/USDC/USDT/DAI等)硬编码验证地址,非验证代币通过DexScreener查询链上数据并强制弹窗警告,阻断地址冒充攻击。

用户体验精细:代币创建需完整收集8项参数(名称/符号/描述/图片/基础代币/防狙击设置/初始购买量/社交链接),杜绝静默默认;图片自动上传至CDN;创建后自动生成Trenches页面链接。

潜在缺点与局限

网络单一性:仅支持Base Mainnet(Chain ID 8453),无法跨链操作。

Gas成本门槛:初始化需部署Safe+Roles模块+CNS注册,预估消耗0.001+ ETH Gas,小额用户可能不经济。

防狙击机制约束:Trenches代币默认开启10分钟防狙击保护,此期间Agent无法买入(包括创建者的初始购买),需等待窗口期满。

外部依赖风险:核心功能依赖KyberSwap API、CoW Protocol API、DexScreener API及Trenches后端,任一服务故障将影响对应功能。

私钥本地存储:Agent私钥以文件形式落盘(权限600),虽设文件级保护,但缺乏操作系统密钥环或硬件钱包集成。

适合的目标群体

  • DeFi活跃用户:熟悉链上交易、理解Gas机制和滑点概念,追求MEV保护和专业聚合报价
  • Trenches生态参与者:需要快速创建代币、管理流动性、追踪市场趋势的Meme币创作者和交易者
  • 安全敏感型用户:重视资金自托管,不愿将私钥托管给中心化交易所或普通Bot
  • 自动化需求者:希望设置特定条件后由Agent执行策略,同时保留最终确认权

不适合:完全不懂区块链的新手(需理解Safe多签、Gas、滑点等概念)、追求跨链交易的用户、需要高频毫秒级交易的专业做市商。

使用风险

交易执行风险:尽管有报价预览,区块链交易仍存在失败可能(流动性不足、价格变动超限),失败交易仍消耗Gas。CoW Protocol的批量拍卖机制可能导致成交时间延迟。

智能合约风险:依赖ZodiacHelpers、AgentKeyFactoryV3等外部合约,虽经社区使用但仍存在潜在漏洞可能。建议定期关注合约升级公告。

API服务风险:Trenches为社区项目(T3级可信度),其API可用性和数据真实性相对主流服务存在更高不确定性。

私钥泄露风险:本地agent.pk文件若被恶意程序读取,攻击者可冒充Agent身份发起交易请求(虽无法直接转走Safe资金,但可消耗Gas或执行授权范围内的交易)。

配置篡改风险:wallet.json配置文件若被修改,可能导致交易发送至错误地址或失败。

监管合规风险:Trenches代币创建功能可能涉及证券法规,用户需自行评估所在司法管辖区合规要求。

技能正文

Clawlett

Secure token swaps and Trenches trading on Base Mainnet, powered by Safe + Zodiac Roles.

Swap engines:

  • KyberSwap (DEX aggregator for optimal routes) — default
  • CoW Protocol (MEV-protected batch auctions)

Token creation & trading: Trenches (via AgentKeyFactoryV3).

Network: Base Mainnet (Chain ID: 8453)

Overview

This skill enables autonomous token swaps and Trenches token creation/trading through a Gnosis Safe. The agent operates through Zodiac Roles which restricts operations to:

  • Swapping tokens via KyberSwap Aggregator (default) or CoW Protocol
  • Creating tokens on Trenches
  • Buying and selling Trenches tokens via factory
  • Approving tokens for KyberSwap Router and CoW Vault Relayer
  • Executing swaps via ZodiacHelpers delegatecall
  • Wrapping ETH to WETH and unwrapping WETH to ETH via ZodiacHelpers
  • Sending swapped tokens only back to the Safe (no draining)

Execution Policy

CRITICAL: The agent MUST NEVER execute an on-chain transaction unless the user explicitly asks for it. The default behavior for any swap, token creation, or trade request is quote/preview only. The agent should show the details and wait for the user to explicitly confirm execution (e.g., "execute", "do it", "go ahead", "yes, swap").

  • "Swap 0.1 ETH for USDC" → get a quote and display it, do NOT execute
  • "Swap 0.1 ETH for USDC and execute" → get a quote, display it, then execute
  • Showing a quote and asking "should I execute?" is fine, but the agent must wait for an affirmative response before executing

This applies to all on-chain operations: swaps, token creation, buys, sells, wrapping/unwrapping.

Capabilities

Action Autonomous Notes
Check balances ✅ ETH and any ERC20 on Base Mainnet
Get swap quote (CoW) ✅ Via CoW Protocol (MEV-protected)
Get swap quote (Kyber) ✅ Via KyberSwap Aggregator (best routes)
Swap tokens (CoW) ⚠️ Requires explicit user confirmation
Swap tokens (Kyber) ⚠️ Requires explicit user confirmation
Wrap/Unwrap ETH ⚠️ Requires explicit user confirmation
Approve tokens ⚠️ Only for CoW Vault Relayer and KyberSwap Router; requires explicit user confirmation
Create token (Trenches) ⚠️ Requires explicit user confirmation
Buy tokens (Trenches) ⚠️ Requires explicit user confirmation
Sell tokens (Trenches) ⚠️ Requires explicit user confirmation
Token info ✅ Fetch token details from Trenches API
Token discovery ✅ Trending, new, top volume, gainers, losers
Transfer funds ❌ Blocked by Roles

Agent Name (CNS)

Each agent can optionally register a unique name via the Clawlett Name Service (CNS). This name is the agent's app-wide identifier — no two agents can share the same name. The name is minted as an NFT on Base.

Pass --name during initialization to register a CNS name. If omitted, CNS registration is skipped. Once registered, it cannot be changed.

Token Safety

Verified Tokens

Protected tokens can ONLY resolve to verified Base Mainnet addresses:

Token Verified Address
ETH Native ETH (0x0000000000000000000000000000000000000000)
WETH 0x4200000000000000000000000000000000000006
USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
USDT 0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2
DAI 0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb
USDS 0x820C137fa70C8691f0e44Dc420a5e53c168921Dc
AERO 0x940181a94A35A4569E4529A3CDfB74e38FD98631
cbBTC 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf
VIRTUAL 0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1b
DEGEN 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed
BRETT 0x532f27101965dd16442E59d40670FaF5eBB142E4
TOSHI 0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4
WELL 0xA88594D404727625A9437C3f886C7643872296AE
BID 0xa1832f7f4e534ae557f9b5ab76de54b1873e498b

If a scam token impersonates these symbols, the agent will detect and warn.

Unverified Token Search

Tokens not in the verified list are searched via DexScreener (Base pairs). Search results include:

  • Contract address (on-chain verified)
  • 24h trading volume and liquidity
  • DEX where the token trades

Agent behavior for unverified tokens:

  • Always display the warning with contract address, volume, and liquidity
  • Ask the user to confirm before proceeding with the swap
  • Never silently swap an unverified token

Setup

  1. Owner provides their wallet address (and optionally an agent name)
  2. Agent generates keypair → Owner sends at least 0.0001 ETH on Base Mainnet to agent for gas (0.001 ETH recommended to cover all deployment transactions)
  3. Agent deploys Safe on Base Mainnet (agent as initial owner)
  4. Agent deploys Zodiac Roles module
  5. Agent configures Roles permissions via MultiSend (enable module, scope targets, assign roles)
  6. Agent registers with backend API
  7. Agent optionally mints CNS name on-chain (if --name provided)
  8. Agent transfers Safe ownership to human owner and removes itself as owner (keeps Roles access)
  9. Agent registers on ERC-8004 Identity Registry and transfers identity NFT to Safe
  10. Owner funds Safe on Base Mainnet with tokens to trade

Usage

Initialize

Initialize my wallet with owner 0x123...
Initialize my wallet with owner 0x123... and name MYAGENT

Check Balance

What's my balance?
How much USDC do I have?

Swap Tokens

Swap 0.1 ETH for USDC
Swap 100 USDC for ETH
Exchange 50 DAI to AERO

Two swap engines are available:

KyberSwap Aggregator (default):

  • Finds optimal routes across multiple DEXs
  • Native ETH supported directly (no wrapping needed)
  • Best for finding the best price across fragmented liquidity
  • 0.1% partner fee

CoW Protocol:

  • MEV-protected batch auctions
  • ETH is automatically wrapped to WETH (CoW requires ERC20s)
  • Best for larger swaps where MEV protection matters
  • 0.5% partner fee

To use CoW Protocol explicitly:

Swap 0.1 ETH for USDC using CoW
Use cow to swap 100 USDC for ETH

Wrap/Unwrap ETH

Wrap 0.5 ETH to WETH
Unwrap 0.5 WETH to ETH

Wrapping and unwrapping is done via ZodiacHelpers delegatecall. When swapping from ETH via CoW, wrapping is handled automatically as part of the swap transaction.

Trenches Trading

Trenches enables token creation and trading on Base. Tokens are created and traded via the AgentKeyFactoryV3 contract.

All on-chain operations go through ZodiacHelpers wrapper functions (createViaFactory, tradeViaFactory) which validate the factory address and forward calls with explicit ethValue (since msg.value doesn't work in delegatecall).

Create a token called "My Token" with symbol MTK
Create a token paired with BID (default base token)
Create a token with anti-bot disabled and an initial buy
Buy 0.01 ETH worth of MTK on Trenches
Buy 100 BID worth of CLAWLETT on Trenches
Buy all my BID into CLAWLETT
Sell all my MTK tokens
What's trending on Trenches?
Show me the top gainers
Get info on MTK token

IMPORTANT — Token creation parameter collection: When a user asks to create a token, the agent MUST collect ALL of the following parameters before executing. If the user's request is missing any of these, ask them to provide the missing values. Do NOT use defaults silently — always confirm each parameter with the user.

Parameter Required Description
Name Yes The token name (e.g., "My Token")
Symbol Yes The token ticker symbol (e.g., MTK)
Description Yes A description of the token
Image Yes Path to a token image file (PNG/JPEG/WEBP, max 4MB)
Base token No BID (default) or ETH — which token to pair with
Anti-bot protection No ON by default (10-minute sniper protection). Ask user if they want it enabled or disabled
Initial buy No Amount of base token (ETH or BID, depending on pair) to buy immediately after creation (only works with anti-bot OFF)
Twitter No Twitter/X handle for the token
Website No Website URL for the token
Team allocation No SSL team positions that the team can claim after the price moves beyond a given position

The agent should present the user with a summary of all parameters (including defaults) and ask for confirmation before executing the creation.

Token creation defaults:

  • Base token: BID (use --base-token ETH for ETH pairing)
  • Anti-bot protection: ON (10-minute sniper protection window)
  • Initial buy is blocked when anti-bot is enabled (agent can't buy during protection window)
  • Use --no-antibot to disable protection and allow initial buy
  • Use --image to attach a custom token image (PNG/JPEG/WEBP, max 4MB)

Image upload flow:

  • Images are uploaded to /api/skill/image before token creation
  • The returned imageUrl is passed to the token creation API
  • If image upload fails, the token creation will fail (image is required)

Anti-bot protection and buying:

  • The agent cannot buy any token that has anti-bot protection currently active (within the 10-minute window after creation)
  • This applies to all tokens, not just ones the agent created
  • Both the client and backend enforce this — the backend will refuse to issue a swap signature for protected tokens
  • Wait for the protection window to expire before buying

Token creation flow:

  1. Upload token image via /api/skill/image (returns imageUrl)
  2. Get creation signature from /api/skill/token/create (includes imageUrl)
  3. Display token details — do NOT execute yet
  4. STOP and wait for the user to explicitly confirm — do not proceed without confirmation
  5. Only after user confirms: execute via Safe + Roles (ZodiacHelpers delegatecall)
  6. After creation, share the token page URL: https://trenches.bid/tokens/[address]

Swap flow:

  1. Resolve token symbols (with scam protection)
  2. Get quote from KyberSwap (default) or CoW Protocol
  3. Display swap details (quote only — do NOT execute yet):
    • Token symbols (e.g., ETH → USDC)
    • Token addresses (verified Base Mainnet contracts)
    • Input amount (what you're selling)
    • Output amount (estimated amount you'll receive)
    • Fee breakdown
  4. STOP and wait for the user to explicitly ask to execute — do not proceed without confirmation
  5. Only after user confirms: execute via Safe + Roles

Scripts

Script Description
initialize.js Deploy Safe + Roles, register CNS name
swap.js Swap tokens via KyberSwap Aggregator (default, optimal routes)
cow.js Swap tokens via CoW Protocol (MEV-protected)
balance.js Check ETH and token balances
trenches.js Create and trade Trenches tokens via factory

Examples

# Initialize (name is optional, registers on CNS if provided)
node scripts/initialize.js --owner 0x123...
node scripts/initialize.js --owner 0x123... --name MYAGENT

# Check balance
node scripts/balance.js
node scripts/balance.js --token USDC

# Swap tokens (KyberSwap Aggregator, default - optimal routes)
node scripts/swap.js --from ETH --to USDC --amount 0.1
node scripts/swap.js --from USDC --to ETH --amount 100 --execute
node scripts/swap.js --from DAI --to AERO --amount 50 --execute --slippage 1

# Swap tokens (CoW Protocol, MEV-protected)
node scripts/cow.js --from ETH --to USDC --amount 0.1
node scripts/cow.js --from USDC --to WETH --amount 100 --execute
node scripts/cow.js --from USDC --to DAI --amount 50 --execute --timeout 600

# With custom slippage (0-0.5 range, e.g., 0.05 = 5%)
node scripts/cow.js --from ETH --to USDC --amount 0.1 --slippage 0.03 --execute

# Trenches: Create a token (BID base token by default, anti-bot ON)
node scripts/trenches.js create --name "My Token" --symbol MTK --description "A cool token"
node scripts/trenches.js create --name "My Token" --symbol MTK --description "desc" --base-token ETH
node scripts/trenches.js create --name "My Token" --symbol MTK --description "desc" --no-antibot --initial-buy 0.01
node scripts/trenches.js create --name "My Token" --symbol MTK --description "desc" --image ./logo.png

# Trenches: Buy/sell tokens (amount is in base token: ETH or BID depending on pair)
node scripts/trenches.js buy --token MTK --amount 0.01
node scripts/trenches.js buy --token CLAWLETT --all
node scripts/trenches.js sell --token MTK --amount 1000
node scripts/trenches.js sell --token MTK --all

# Trenches: Token info and discovery
node scripts/trenches.js info MTK
node scripts/trenches.js trending
node scripts/trenches.js trending --window 1h --limit 5
node scripts/trenches.js new
node scripts/trenches.js top-volume
node scripts/trenches.js gainers
node scripts/trenches.js losers

Configuration

Scripts read from config/wallet.json (configured for Base Mainnet):

{
  "chainId": 8453,
  "owner": "0x...",
  "agent": "0x...",
  "safe": "0x...",
  "roles": "0x...",
  "roleKey": "0x...",
  "name": "MYAGENT",
  "cnsTokenId": 1
}

Environment Variables

Variable Default Description
BASE_RPC_URL https://mainnet.base.org Base Mainnet RPC endpoint
WALLET_CONFIG_DIR config Config directory
TRENCHES_API_URL https://trenches.bid Trenches API endpoint

Contracts (Base Mainnet)

Contract Address Description
Safe Singleton 0x3E5c63644E683549055b9Be8653de26E0B4CD36E Safe L2 impl
CoW Settlement 0x9008D19f58AAbD9eD0D60971565AA8510560ab41 CoW Protocol settlement
CoW Vault Relayer 0xC92E8bdf79f0507f65a392b0ab4667716BFE0110 CoW token allowance target
KyberSwap Router 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5 KyberSwap Meta Aggregation Router V2
ZodiacHelpers 0x38441B5bd6370b000747c97a12877c83c0A32eaF Approvals, CoW presign, KyberSwap, WETH wrap/unwrap, Trenches factory wrappers via delegatecall
AgentKeyFactoryV3 0x2EA0010c18fa7239CAD047eb2596F8d8B7Cf2988 Trenches token creation and trading
Safe Factory 0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2 Safe deployer
Roles Singleton 0x9646fDAD06d3e24444381f44362a3B0eB343D337 Zodiac Roles
Module Factory 0x000000000000aDdB49795b0f9bA5BC298cDda236 Module deployer
CNS 0x299319e0BC8d67e11AD8b17D4d5002033874De3a Clawlett Name Service (unique agent names)

Updating

When the user says "update to latest", follow this procedure:

  1. git fetch --tags origin in the clawlett repo
  2. Read current version from scripts/package.json
  3. Identify the latest git tag (e.g., git tag -l --sort=-v:refname | head -1)
  4. Read MIGRATION_GUIDE.md for the migration path between current and latest version
  5. Show the user: current version, new version, summary of changes, and whether on-chain steps are required
  6. ASK the user: "Do you want to proceed with this update?" — do NOT proceed without explicit confirmation
  7. If confirmed: git checkout <tag>, then walk through each migration step with the user

Some updates are code-only (just checkout the new tag). Others require on-chain transactions signed by the Safe owner (e.g., updating Roles permissions for a new ZodiacHelpers contract). The migration guide specifies which.

Security Model

  1. Safe holds all funds - Agent wallet only has gas
  2. Zodiac Roles restricts operations:
    • Can only interact with ZodiacHelpers
    • ZodiacHelpers scoped with allowTarget (Send + DelegateCall)
    • Can only approve tokens for CoW Vault Relayer and KyberSwap Router
  3. No transfer/withdraw - Agent cannot move funds out
  4. Scam protection - Common tokens resolve to verified addresses only
  5. MEV protection - CoW Protocol batches orders, preventing sandwich attacks and other MEV extraction

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill