4Claw Mint
Mint 4Claw (symbol: 4) tokens on BSC. Only OpenClaw agents can mint — the contract requires a signature from the authorized signer service.
Token Info
- - Name: 4Claw, Symbol: 4
- Chain: BSC (Chain ID: 56)
- Contract: INLINECODE0
- Total Supply: 1,000,000
- Public Mint: 600,000 (100 per mint, 6000 total mints)
- LP Reserve: 400,000 (pre-minted to deployer)
- Cooldown: 15 minutes per wallet
How It Works
- 1. Agent calls the signer service with its wallet address
- Service checks cooldown, generates nonce + deadline, signs the mint authorization
- Agent submits the signature to the on-chain contract
- Contract verifies signature, enforces cooldown, mints 100 tokens
Mint
Run the mint script with the agent's wallet private key:
CODEBLOCK0
- -
PRIVATE_KEY: Agent's BSC wallet private key (needs small BNB for gas) - INLINECODE2 : Signer service URL (default: http://43.160.201.224:3456)
The script handles everything: request signature → send tx → confirm → report balance.
Signer Service
The signer service must be running for mints to work. It validates requests and signs mint authorizations.
CODEBLOCK1
Endpoints:
- -
POST /api/mint-signature — Request a mint signature. Body: INLINECODE4 - INLINECODE5 — Check service status
Contract
Source: INLINECODE6
Key functions:
- -
mint(nonce, deadline, signature) — Mint 100 tokens (requires valid signer signature) - INLINECODE8 — Check when an address last minted
- INLINECODE9 — How many public mint tokens are left
- INLINECODE10 — Owner can update the signer address
Setup for Deployer
- 1. Deploy
FourClaw.sol to BSC with constructor args: INLINECODE12 - Set env vars and start the signer service
- Share the skill — any OpenClaw agent with a BSC wallet can mint
Error Handling
- - Cooldown not elapsed: Wait 15 minutes between mints
- Public mint exhausted: All 600,000 tokens have been minted
- Signature expired: Signature is valid for 5 minutes, retry
- Invalid signature: Signer service may be misconfigured
- Insufficient BNB: Agent wallet needs BNB for gas (~0.001 BNB per mint)
4Claw Mint
在BSC上铸造4Claw(符号:4)代币。只有OpenClaw代理可以铸造——合约需要来自授权签名者服务的签名。
代币信息
- - 名称:4Claw,符号:4
- 链:BSC(链ID:56)
- 合约:0x5F4E6Ee459fA71C226131BCeD5694aAab3b481dB
- 总供应量:1,000,000
- 公开铸造:600,000(每次铸造100个,共6000次铸造)
- 流动性储备:400,000(预铸造给部署者)
- 冷却时间:每个钱包15分钟
工作原理
- 1. 代理使用其钱包地址调用签名者服务
- 服务检查冷却时间,生成随机数+截止时间,签署铸造授权
- 代理将签名提交到链上合约
- 合约验证签名,执行冷却时间,铸造100个代币
铸造
使用代理的钱包私钥运行铸造脚本:
bash
node scripts/mint.js KEY> URL>
- - PRIVATEKEY:代理的BSC钱包私钥(需要少量BNB作为燃料费)
- SERVERURL:签名者服务URL(默认:http://43.160.201.224:3456)
脚本处理所有操作:请求签名 → 发送交易 → 确认 → 报告余额。
签名者服务
签名者服务必须运行才能进行铸造。它验证请求并签署铸造授权。
bash
SIGNERPRIVATEKEY=0x... CONTRACT_ADDRESS=0x... node scripts/server.js
端点:
- - POST /api/mint-signature — 请求铸造签名。请求体:{wallet_address: 0x...}
- GET /api/status — 检查服务状态
合约
源码:references/FourClaw.sol
关键函数:
- - mint(nonce, deadline, signature) — 铸造100个代币(需要有效的签名者签名)
- lastMintTime(address) — 检查地址上次铸造的时间
- mintRemaining() — 剩余公开铸造代币数量
- setSigner(address) — 所有者可以更新签名者地址
部署者设置
- 1. 使用构造函数参数将FourClaw.sol部署到BSC:(signerAddress, lpWalletAddress)
- 设置环境变量并启动签名者服务
- 分享技能——任何拥有BSC钱包的OpenClaw代理都可以铸造
错误处理
- - 冷却时间未到:两次铸造之间等待15分钟
- 公开铸造已耗尽:所有600,000个代币已被铸造完毕
- 签名已过期:签名有效期为5分钟,请重试
- 无效签名:签名者服务可能配置错误
- BNB不足:代理钱包需要BNB作为燃料费(每次铸造约0.001 BNB)