Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- Config, docs, scripts, and backup manifests - Submodule refs unchanged (m = modified content in submodules) Made-with: Cursor
2.7 KiB
2.7 KiB
Chain 138 Token Support for x402 Payments
Purpose: Record which Chain 138 tokens support ERC-2612 (permit) or ERC-3009, and thus can be used with thirdweb x402 payments.
References: thirdweb x402, CHAIN138_TOKEN_ADDRESSES.md, plan: x402 and Permit Support for Chain 138.
On-chain check results
Run the verification script (from repo root, with Chain 138 RPC reachable):
./scripts/verify/check-chain138-token-permit-support.sh [RPC_URL]
# Optional: --dry-run to print RPC and token addresses only
Last run: Script confirms the following for deployed contracts on Chain 138.
| Token | Address | ERC-2612 (permit) | ERC-3009 (transferWithAuthorization) | x402-compatible |
|---|---|---|---|---|
| cUSDT | 0x93E66202A11B1772E55407B32B44e5Cd8eda7f22 |
Not supported | Not supported | No |
| cUSDC | 0xf22258f57794CC8E06237084b353Ab30fFfa640b |
Not supported | Not supported | No |
WETH and WETH10 on Chain 138 (see CHAIN138_TOKEN_ADDRESSES.md) are standard approve/transferFrom implementations and do not expose permit or ERC-3009 in the repo; they are not x402-compatible in their current form.
Implications
- thirdweb x402 requires the payment token to support either ERC-2612 permit or ERC-3009 (e.g. sign +
transferWithAuthorization/receiveWithAuthorization). See Chain and token support. - Current state: No deployed Chain 138 token in the canonical list (cUSDT, cUSDC, WETH, WETH10, LINK) is x402-compatible until one of them implements permit or ERC-3009.
- Options:
- Use another chain for x402 testing: e.g. Arbitrum Sepolia with USDC (default in thirdweb x402). The x402 API sketch can be built and tested there, then switched to Chain 138 once a token supports permit.
- Add ERC-2612 to compliant tokens: Implement and deploy new CompliantUSDT/CompliantUSDC contracts that extend OpenZeppelin
ERC20Permit(see plan: Part 1.2 Option B). This implies new contract addresses and updates to CHAIN138_TOKEN_ADDRESSES.md and env/config.
When a Chain 138 token gains permit
After a token on Chain 138 supports ERC-2612 or ERC-3009:
- Re-run
./scripts/verify/check-chain138-token-permit-support.shand update this doc. - In the x402 API, use
network: chain138(custom chain definition) and setpriceto the token object, e.g.price: { amount: "<base units>", asset: { address: "<token address>", decimals: 6 } }for cUSDC/cUSDT.