AGENT SKILL

token-allowance

Manage ERC20 token approvals and allowances.

License 许可
AGPL-3.0
最近更新
2026-11-12
Stars
★ 81
Forks
17

01 前言 Front Matter

name
token-allowance
tags
[ "web3", "erc20", "defi", "security", "allowance" ]
author
SpoonOS Contributor
version
1.0.0
description
Manage ERC20 token approvals and allowances.

02 资源文件 4

03 SKILL.md 正文

Token Allowance Manager

A security-focused skill to manage ERC20 token approvals. It allows agents to check current allowances, approve spenders (like DEX routers), and revoke permissions to secure funds.

Quick Start

# Check if Uniswap Router has access to my USDC
allowance = await agent.run_tool(
    "manage_allowance",
    action="check",
    token_address="0xA0b8...",
    spender_address="0xE592..."
)

# Approve 100 USDC
await agent.run_tool(
    "manage_allowance",
    action="approve",
    token_address="0xA0b8...",
    spender_address="0xE592...",
    amount=100.0
)

Scripts

Script Purpose
allowance.py Checks and manages ERC20 allowances

Environment Variables

Variable Required Description
WEB3_RPC_URL Yes RPC URL for the blockchain
PRIVATE_KEY Yes Required for 'approve' and 'revoke' actions

Best Practices

  1. Always check allowance before approving (avoid unnecessary txs).
  2. Approve exact amounts rather than infinite (security best practice).
  3. Revoke allowances for unused DApps to prevent hacks.

04 同仓库更多 Skills