AgentSkillsCN

usdc-escrow-agent

自主式USDC托管交易演示(Base Sepolia)——客户端与工作者智能体通过链上状态进行协同,并以USDC完成支付。

SKILL.md
--- frontmatter
name: usdc-escrow-agent
description: Autonomous USDC escrow commerce demo (Base Sepolia) — client/worker agents coordinate via onchain state and pay out USDC.
metadata: {"clawdbot":{"config":{"requiredEnv":["RPC_URL","USDC_ADDRESS","DEPLOYER_PRIVATE_KEY","CLIENT_PRIVATE_KEY","WORKER_PRIVATE_KEY"],"example":"# then: npm run check && npm run deploy && npm run worker && npm run client"}}}

USDC Escrow Agent (AgenticCommerce)

This skill-pack is a minimal, testnet-only demonstration of agentic commerce:

  • A client agent deposits USDC into an onchain escrow task.
  • A worker agent autonomously accepts the task.
  • The client agent completes the task and triggers an onchain USDC payout.

Coordination is purely via smart contract state/events (no UI, no human-in-loop after start).

Chain

  • Base Sepolia (chainId 84532)
  • USDC uses 6 decimals

What proves it worked

  • TaskCreated, TaskAccepted, TaskCompleted events (tx hashes)
  • Final USDC balance of the worker wallet (printed by client)

Setup

  1. Install dependencies
bash
npm install
  1. Create .env (never commit it)
bash
# copy example and fill real values
cp .env.example .env

Required env:

  • RPC_URL (Base Sepolia JSON-RPC)
  • USDC_ADDRESS (USDC token on Base Sepolia testnet)
  • DEPLOYER_PRIVATE_KEY (deploy contract)
  • CLIENT_PRIVATE_KEY (approves + creates + completes)
  • WORKER_PRIVATE_KEY (accepts)
  1. Verify env
bash
npm run check
  1. Fund wallets (recommended)
bash
npm run fund

Deploy

bash
npm run deploy

Copy the printed address into ESCROW_ADDRESS in .env.

PowerShell shortcut (auto-write ESCROW_ADDRESS):

powershell
$env:WRITE_ENV='true'; npm run deploy; Remove-Item Env:WRITE_ENV

Run agents (two terminals)

Worker:

bash
npm run worker

Client:

bash
npm run client

Proof (BaseScan links)

bash
npm run proof

Notes for OpenClaw / Clawdbot users

  • In OpenClaw, you can install this skill-pack (via ClawHub) and have your bot run npm run worker and npm run client as autonomous actions.
  • The bot’s “agent-ness” is validated by the onchain trail (events + balances), not by a UI.