Permit2 contract.
This allows the Permit2 contract to transfer the USDC from your wallet to the
FxEscrow contract. This guide shows an example of how to grant a USDC token
allowance to the Permit2 contract using a Circle Wallets developer-controlled
wallet. The
Permit2 documentation
provides additional examples of how to grant this allowance.
Prerequisites
Before you begin, ensure you have:- Installed Node.js and npm on your development machine
- A project initialized with
npm init -y @circle-fin/developer-controlled-walletsanddotenvinstalled in your project
- A project initialized with
- Created a Circle Developer Account
- Registered your entity secret
- Created a new wallet set using the API
- Created at least one EOA wallet for Arc in the wallet set (see the link in the previous bullet)
- Have access to the wallet ID for the EOA wallet
- Funded the wallet with testnet USDC
- Created a
.envfile in your project root with the following variables defined:CIRCLE_API_KEYCIRCLE_ENTITY_SECRETCIRCLE_WALLET_ID
Steps
The following steps show how to grant a USDC token allowance to thePermit2
contract using an EIP-1193 Ethereum wallet.
Step 1. 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 an EIP-1193 Ethereum wallet.
JavaScript