Skip to main content
For Transactions V2 on EVM blockchains, there is a dependency on the Permit2 contract to enable allowance management. To get the benefits of Transactions V2, you must grant a USDC token allowance to the Permit2 contract. This guide shows two examples of how to grant a USDC token allowance to the Permit2 contract. The Permit2 documentation provides additional examples of how to grant this allowance.

Prerequisites

The examples on this page show how to grant a USDC token allowance to the Permit2 contract using a Circle Wallets developer-controlled wallet or a generic EIP-1193 Ethereum wallet. Before you begin, ensure you have:
  • If you are following the Circle Wallets example:
  • Node.js and npm installed on your development machine
  • A project set up as described in the below section

Set up your project

  1. Initialize a new Node.js project and install dependencies:
  2. In the project root, create a .env file and add the following variables:
    The PERMIT2_CONTRACT_ADDRESS is the same across all EVM blockchains (0x000000000022D473030F116dDEE9F6B43aC78BA3), but you should verify it with the blockchain explorer on the chain you are using. You can find the USDC_CONTRACT_ADDRESS on the USDC contract address page.
    The USDC token has 6 decimals. To approve $100 USDC, set APPROVAL_AMOUNT to 100000000 (100 * 106).
    If you are following the Circle Wallets example, you will also need to add the following variables:
    If you are following the EIP-1193 Ethereum wallet example, or your Circle Wallet is on the generic EVM / EVM-TESTNET chain, you will also need to add the following variable:
  3. Create an index.js file. You’ll add code step by step in the following sections.

Grant a USDC token allowance to the Permit2 contract

The following example code shows the process for granting a USDC token allowance to the Permit2 contract using a Circle Wallets developer-controlled wallet or an EIP-1193 Ethereum wallet.
This example is for a Circle Wallets developer-controlled wallet on specific EVM blockchains (for example, ETH, ETH-SEPOLIA, MATIC, MATIC-AMOY, etc.). If your Circle Wallet is on the generic EVM / EVM-TESTNET chain, use the example in the “Circle Wallets (generic EVM)” tab.