Skip to main content
This example transfers 1 USDC on Base using Permit3. It uses the single-chain signed-permit overload from the current interface.

Prerequisites

  • A TypeScript project with viem installed.
  • A Base RPC URL and a viem account that can sign transactions and typed data.
  • At least 1 USDC and enough ETH on Base for gas.
  • An existing USDC allowance of at least 1 USDC from the owner to Permit3. This token approval is separate from the signed permit.
  • A recipient address you control or intend to pay.
The Permit3 deployment record lists the address used below. Check the deployment and approval target before approving tokens.

Sign and execute

The code reads hashChainPermits from the contract instead of recreating its hashing algorithm. The permit identifies Base (8453) as the execution chain, while the EIP-712 domain uses the fixed chain ID 1 required by Permit3.
The function submits a mainnet transfer when you call it. Simulation and gas estimation run first, but state can change before the transaction is mined. Check the confirmed transfer and recipient balance in your application.

Multi-chain permits and witnesses

For multi-chain authorization, hash each chain’s permits, build the matching Merkle root and proofs, and use the overload that takes ChainPermits plus a proof array. Submit each chain’s transaction separately. Use the repository’s cross-chain guide with the matching interface. Witness permits add signed application data. Validate that data against the action your application performs; a signed hash alone does not enforce those conditions.

Troubleshooting

Next steps

Use Permit3 API funding when funding a Routes quote through the API. Read Permit3 concepts for allowance modes and multi-chain behavior.