upto
payments move USDC through the Permit2
contract, so the buyer’s USDC allowance for Permit2 must cover each payment.
There are two ways to grant the allowance:
- Onchain approval: one
approvetransaction grants Permit2 spending power indefinitely. Best when the buyer transacts repeatedly and can hold the gas asset. - Gasless permit: the buyer signs an EIP-2612 permit for each payment, which you, as the seller, attach to the Facilitator Service call. Best when the buyer can’t hold the gas asset or integrates purely offchain, since Circle pays settlement gas when the permit is applied.
- Onchain approval
- Gasless permit
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22.6+
- Installed viem
- Funded the buyer wallet with Arc testnet USDC from the Circle Faucet
Grant the allowance onchain
Send oneapprove from the buyer, with Permit2 as the spender. The example
targets Arc testnet.approve-permit2.ts
This example approves
maxUint256, which lets Permit2 move any amount of the
buyer’s USDC indefinitely. For production, consider approving only what each
payment needs and refreshing allowances periodically./verify or /settle.