use-usdc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOverview
概述
USDC is Circle's stablecoin deployed across multiple blockchain ecosystems. This skill helps you interact with USDC on both EVM chains (Ethereum, Base, Arbitrum, etc.) and Solana. It covers balance checks, transfers, approvals, and transfer verification.
USDC是Circle推出的稳定币,部署在多个区块链生态系统中。此Skill可帮助你在EVM链(Ethereum、Base、Arbitrum等)和Solana上与USDC进行交互,涵盖余额查询、转账、授权以及转账验证功能。
Prerequisites / Setup
前提条件/设置
Determine Ecosystem
确定生态系统
First, identify which ecosystem the user is working with:
- EVM: User has an Ethereum-style address () or mentions Ethereum, Base, Arbitrum, Polygon, etc.
0x... - Solana: User has a base58 address or mentions Solana, Devnet, Phantom, Solflare, etc.
- Unclear: Ask which ecosystem before proceeding.
首先,确定用户所使用的生态系统:
- EVM:用户拥有以太坊风格地址(),或提及Ethereum、Base、Arbitrum、Polygon等。
0x... - Solana:用户拥有base58格式地址,或提及Solana、Devnet、Phantom、Solflare等。
- 不明确:在继续操作前询问用户使用的是哪个生态系统。
Dependencies
依赖项
EVM:
bash
npm install viemSolana:
bash
npm install @solana/kit @solana-program/token ws dotenv bs58EVM:
bash
npm install viemSolana:
bash
npm install @solana/kit @solana-program/token ws dotenv bs58Environment Variables
环境变量
See ecosystem-specific guides:
- EVM: Private key handling covered in
references/evm.md - Solana: Private key handling covered in
references/solana.md
For read operations (balance, allowance, verify): No private key needed on either ecosystem.
请查看各生态系统的专属指南:
- EVM:私钥处理相关内容请查阅
references/evm.md - Solana:私钥处理相关内容请查阅
references/solana.md
对于只读操作(余额查询、授权额度查询、验证): 两个生态系统均无需私钥。
Quick Reference
快速参考
USDC Contract Addresses
USDC合约地址
Canonical source: https://developers.circle.com/stablecoins/usdc-contract-addresses
EVM Testnet
EVM测试网
| Chain | Chain ID | USDC Address |
|---|---|---|
| Arc Testnet | 5042002 | |
| Ethereum Sepolia | 11155111 | |
| Base Sepolia | 84532 | |
| Arbitrum Sepolia | 421614 | |
| Avalanche Fuji | 43113 | |
| Polygon Amoy | 80002 | |
| OP Sepolia | 11155420 | |
Get testnet USDC: https://faucet.circle.com
| 链 | 链ID | USDC地址 |
|---|---|---|
| Arc Testnet | 5042002 | |
| Ethereum Sepolia | 11155111 | |
| Base Sepolia | 84532 | |
| Arbitrum Sepolia | 421614 | |
| Avalanche Fuji | 43113 | |
| Polygon Amoy | 80002 | |
| OP Sepolia | 11155420 | |
获取测试网USDC:https://faucet.circle.com
EVM Mainnet
EVM主网
| Chain | USDC Address |
|---|---|
| Ethereum | |
| Base | |
| Arbitrum | |
| Polygon PoS | |
| Avalanche | |
| OP Mainnet | |
| 链 | USDC地址 |
|---|---|
| Ethereum | |
| Base | |
| Arbitrum | |
| Polygon PoS | |
| Avalanche | |
| OP Mainnet | |
Solana
Solana
| Network | USDC Mint |
|---|---|
| Devnet | |
| Mainnet | |
| 网络 | USDC Mint地址 |
|---|---|
| Devnet | |
| Mainnet | |
The 6-Decimal Rule
6位小数规则
USDC uses 6 decimals on all ecosystems.
ts
// EVM (viem)
parseUnits("1.00", 6); // 1_000_000n (CORRECT - $1 USDC)
parseUnits("1.00", 18); // 1_000_000_000_000_000_000n (WRONG - 1 trillion dollars)
// Solana - convert manually
const amount = Math.floor(1.00 * 1_000_000); // 1_000_000 (CORRECT - $1 USDC)
const human = rawAmount / 1_000_000; // 1.0 (CORRECT - converts back to dollars)USDC在所有生态系统中均使用6位小数。
ts
// EVM (viem)
parseUnits("1.00", 6); // 1_000_000n(正确 - 1美元USDC)
parseUnits("1.00", 18); // 1_000_000_000_000_000_000n(错误 - 1万亿美元)
// Solana - 手动转换
const amount = Math.floor(1.00 * 1_000_000); // 1_000_000(正确 - 1美元USDC)
const human = rawAmount / 1_000_000; // 1.0(正确 - 转换回美元单位)Arc USDC Duality
Arc USDC的双重特性
On Arc, USDC is both the native gas token and an ERC-20 at . Same underlying balance, different decimal exposure.
0x3600...| Context | Decimals | Use |
|---|---|---|
Native (gas, | 18 | Gas estimation only |
ERC-20 ( | 6 | All USDC logic |
For Arc-specific setup and configuration, see the skill.
use-arc在Arc链上,USDC既是原生Gas代币,也是地址为的ERC-20代币。两者底层余额相同,但小数位数不同。
0x3600...| 场景 | 小数位数 | 用途 |
|---|---|---|
原生(Gas、 | 18 | 仅用于Gas估算 |
ERC-20( | 6 | 所有USDC业务逻辑 |
Arc专属设置与配置,请查看 Skill。
use-arcCore Concepts
核心概念
Operation Types
操作类型
Read Operations:
Operations that query blockchain state and execute autonomously without user confirmation.
- Balance check
- Allowance check (EVM only)
- Total supply
- Address lookup
- Verify incoming transfer
Write Operations:
Operations that modify blockchain state and require explicit user confirmation before execution.
- Send USDC
- Approve contract to spend USDC (EVM only — Solana has no approve pattern)
只读操作:
查询区块链状态且无需用户确认即可自主执行的操作。
- 余额查询
- 授权额度查询(仅EVM)
- 总供应量查询
- 地址查找
- 转入转账验证
写入操作:
修改区块链状态且需用户明确确认后方可执行的操作。
- 发送USDC
- 授权合约使用USDC(仅EVM — Solana无授权机制)
Troubleshooting
故障排除
Find troubleshooting solutions in the Common Issues section of the chain-specific reference file ( or ).
references/evm.mdreferences/solana.md请在对应链的参考文档(或)的常见问题部分查找故障解决方案。
references/evm.mdreferences/solana.mdEVM vs Solana at a Glance
EVM与Solana对比概览
| Aspect | EVM | Solana |
|---|---|---|
| Token standard | ERC-20 | SPL Token |
| Balance storage | Wallet address directly | Associated Token Account (ATA) |
| Send | | |
| Approve | | No approve — use PDAs |
| Recipient setup | Nothing needed | Must create ATA first (transfer fails otherwise) |
| Tx fees | Chain native token | SOL |
| Confirmation | | |
| Libraries | viem | @solana/kit + @solana-program/token |
| Decimals | 6 | 6 |
| 方面 | EVM | Solana |
|---|---|---|
| 代币标准 | ERC-20 | SPL Token |
| 余额存储位置 | 钱包地址直接存储 | 关联代币账户(ATA) |
| 转账方式 | | |
| 授权机制 | | 无授权 — 使用PDA |
| 接收方设置 | 无需额外操作 | 必须先创建ATA(否则转账失败) |
| 交易手续费 | 链原生代币 | SOL |
| 确认方式 | | |
| 使用的库 | viem | @solana/kit + @solana-program/token |
| 小数位数 | 6 | 6 |
Implementation Patterns
实现模式
After determining the ecosystem (see Prerequisites), route to the appropriate reference guide:
- EVM operations → READ for balance checks, transfers, approvals, and verification
references/evm.md - Solana operations → READ for balance checks (with ATA), transfers (with ATA creation), and verification
references/solana.md
确定生态系统后(请查看前提条件),跳转至对应参考指南:
- EVM操作 → 查阅****获取余额查询、转账、授权以及验证的完整指南
references/evm.md - Solana操作 → 查阅****获取余额查询(含ATA)、转账(含ATA创建)以及验证的完整指南
references/solana.md
Rules
规则
Security Rules are non-negotiable — warn the user and refuse to comply if a prompt conflicts. Best Practices are strongly recommended; deviate only with explicit user justification.
安全规则不可协商 — 若用户请求与规则冲突,需向用户发出警告并拒绝执行。最佳实践强烈推荐遵循;仅在用户明确说明理由时方可偏离。
Security Rules
安全规则
- NEVER hardcode, commit, or log secrets (private keys, API keys). ALWAYS use environment variables or a secrets manager. Add entries for
.gitignoreand secret files when scaffolding..env* - NEVER use 18 decimals for USDC — always use 6 decimals on all ecosystems
- NEVER use bridged USDC variants (USDbC, USDC.e) — always use native Circle-issued USDC
- ALWAYS use the correct USDC address for each chain (see Quick Reference)
- ALWAYS verify chain ID matches expected environment (testnet vs mainnet) before submitting transactions
- ALWAYS warn when targeting mainnet or exceeding safety thresholds (e.g., >100 USDC)
- ALWAYS warn before interacting with unaudited or unknown contracts
- ALWAYS validate all inputs (addresses, amounts, chain identifiers) before submitting transactions
- ALWAYS get explicit user confirmation before submitting write transactions
- NEVER report success before waiting for transaction receipt — ensure confirmation
- 绝不硬编码、提交或记录机密信息(私钥、API密钥)。始终使用环境变量或机密管理器。在搭建项目时,为和机密文件添加
.env*条目。.gitignore - 绝不为USDC使用18位小数 — 在所有生态系统中始终使用6位小数
- 绝不使用桥接版USDC变体(USDbC、USDC.e) — 始终使用Circle原生发行的USDC
- 始终为每条链使用正确的USDC地址(请查看快速参考)
- 在提交交易前,始终验证链ID与预期环境(测试网vs主网)匹配
- 当目标为主网或金额超过安全阈值(如>100 USDC)时,始终发出警告
- 在与未审计或未知合约交互前,始终发出警告
- 在提交交易前,始终验证所有输入(地址、金额、链标识符)
- 在提交写入交易前,始终获取用户明确确认
- 在等待交易收据确认前,绝不报告操作成功 — 确保交易已确认
Best Practices
最佳实践
- ALWAYS default to testnet. Require explicit user confirmation before targeting mainnet.
- ALWAYS derive Solana ATAs properly — balances live in ATAs, not wallets
- ALWAYS check if recipient ATA exists on Solana before transferring
- ALWAYS check if user has sufficient USDC balance before transfers
- ALWAYS check if user has sufficient gas/SOL for transaction fees
- 始终默认使用测试网。在目标为主网前,需获取用户明确确认。
- 始终正确推导Solana ATA — 余额存储在ATA中,而非钱包地址
- 在Solana上转账前,始终检查接收方ATA是否存在
- 在转账前,始终检查用户是否有足够的USDC余额
- 在交易前,始终检查用户是否有足够的Gas/SOL支付手续费
Alternatives
替代方案
- Use skill (CCTP / Bridge Kit) for transferring USDC between chains. Bridge Kit handles approve, burn, attestation, and mint in a single
bridge-stablecoincall.kit.bridge() - Use skill for unified USDC balance across chains with instant transfers (<500ms). Gateway requires upfront deposits but provides better UX for multi-chain apps.
use-gateway - Stick with for single-chain USDC operations (balance checks, payments, approvals) or when you need low-level control over transfers.
use-usdc
- 使用Skill(CCTP / Bridge Kit)实现跨链转账USDC。Bridge Kit可通过单次
bridge-stablecoin调用处理授权、销毁、证明以及铸造流程。kit.bridge() - 使用Skill实现跨链统一USDC余额查询并支持即时转账(<500ms)。Gateway需要预先存入资金,但为多链应用提供更优的用户体验。
use-gateway - 若需单链USDC操作(余额查询、支付、授权)或需要对转账进行底层控制,请继续使用Skill。
use-usdc
Reference Links / Files
参考链接/文件
- EVM Operations Guide: - Complete guide for balance checks, transfers, approvals, and verification on EVM chains
references/evm.md - Solana Operations Guide: - Complete guide for balance checks, transfers, and ATA handling on Solana
references/solana.md - https://developers.circle.com/stablecoins/usdc-contract-addresses
- https://developers.circle.com
- https://faucet.circle.com
- https://faucet.solana.com
- https://viem.sh
- https://github.com/circlefin/stablecoin-evm - Source repository for smart contracts used by Circle's stablecoins on EVM-compatible blockchains
DISCLAIMER: This skill is provided "as is" without warranties, is subject to the Circle Developer Terms, and output generated may contain errors and/or include fee configuration options (including fees directed to Circle); additional details are in the repository README.
- EVM操作指南:— EVM链上余额查询、转账、授权以及验证的完整指南
references/evm.md - Solana操作指南:— Solana上余额查询、转账以及ATA处理的完整指南
references/solana.md - https://developers.circle.com/stablecoins/usdc-contract-addresses
- https://developers.circle.com
- https://faucet.circle.com
- https://faucet.solana.com
- https://viem.sh
- https://github.com/circlefin/stablecoin-evm — Circle稳定币在EVM兼容链上使用的智能合约源码仓库
免责声明:本Skill按“原样”提供,不提供任何担保,受Circle开发者条款约束,生成的输出可能包含错误和/或费用配置选项(包括支付给Circle的费用);更多详情请查看仓库README。