USDC EIP-712 domain: "USD Coin" or "USDC"?
USDC's FiatToken contracts sign typed data (EIP-2612 permit, EIP-3009 transferWithAuthorization / receiveWithAuthorization) against an EIP-712 domain built from name(), version(), the chain ID and the contract address. The name is not the same everywhere.
| Domain name | Chains |
|---|---|
USD Coin | Ethereum, Base, Arbitrum One, OP Mainnet, Polygon PoS, Avalanche C-Chain, Arbitrum Sepolia, Avalanche Fuji |
USDC | Linea, ZKsync Era, Unichain, World Chain, Sonic, Celo, Sei EVM, Ink, HyperEVM, Cronos, XDC Network, Monad, Plasma, Plume, X Layer, Morph, Injective EVM, Base Sepolia, Ethereum Sepolia, OP Sepolia, Polygon Amoy, Arc Testnet |
Version is "2" on all 30 contracts checked. Note that Base mainnet says USD Coin while Base Sepolia says USDC, so code that works on testnet can break on mainnet.
Symptoms of the wrong domain
FiatTokenV2: invalid signatureorEIP2612: invalid signaturereverts- x402 facilitator
/verifyreturnsinvalid_exact_evm_payload_signature - ecrecover returns an address that is not the payer
Fix: read it from the contract
import { createPublicClient, http } from "viem";
const [name, version] = await Promise.all([
client.readContract({ address: usdc, abi, functionName: "name" }),
client.readContract({ address: usdc, abi, functionName: "version" }),
]);
const domain = { name, version, chainId, verifyingContract: usdc };
Or copy the verified values from the table.