Circle Gateway allows you to establish a unified USDC balance consisting of USDC stored on multiple source chains. Once established, you can transfer this balance instantly to any destination chain. This guide demonstrates how to establish a unified USDC balance by depositing USDC into the Gateway Wallet contract. You can perform this action on multiple chains to establish a chain-abstracted balance.Documentation Index
Fetch the complete documentation index at: https://circle-devdocs-test-ai-codegen-component.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js and npm on your development machine
- Created a testnet wallet on Ethereum Sepolia and have the private key available
- Funded your testnet wallet with USDC and native tokens
-
Created a new Node project and have the following dependencies installed:
viemdotenv
-
You’ve set up a
.envfile with the following variables:
Steps
Follow these steps to establish a unified USDC balance. Note that this example demonstrates how to deposit USDC on a single chain (Ethereum Sepolia). Repeat these steps on other chains to add to your balance.Step 1. Approve the Gateway Wallet to transfer USDC from your address
Create a new file calledindex.js in the root of your project, and add the
following code to it. This code calls the approve() method on the USDC
contract to allow the Gateway Wallet contract to transfer USDC from your wallet.
Javascript
Step 2. Call the deposit method on the Gateway Wallet contract
Add the following code to theindex.js file to call the deposit() method on
the Gateway Wallet contract. Note that you must use the deposit() method and
not the standard transfer on the USDC contract.
Javascript
Step 3. Run the script
Once you have added the code to yourindex.js file, run it with the following
command:
Shell