A smart contract account (SCA) can also authorize transfers directly through
ERC-1271, without adding a delegate at all.
See How-to: Transfer USDC from a smart contract
account.
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22.6+
- Created a Circle Console account
- Obtained an API key and registered your Entity Secret
-
Created two wallets via Circle developer-controlled wallets:
- The depositor wallet holds your Gateway USDC deposits
- The delegate wallet will sign burn intents on behalf of the depositor
- Deposited USDC into the Gateway Wallet from your depositor wallet
- Created a TypeScript project with the Developer-Controlled Wallets SDK installed
-
Set up a
.envfile with the following variables:.env
Add a delegate
Follow these steps to authorize a delegate to sign burn intents on behalf of your depositor wallet.Step 1. Create the add delegate script
Create a new file calledadd-delegate.ts in the root of your project and add
the following code. This calls the
addDelegate()
method on the Gateway Wallet contract on Arc Testnet.
add-delegate.ts
Step 2. Run the script
Run the script with the following command:Step 3. Repeat for other blockchains
To add the delegate on additional blockchains where the depositor holds Gateway deposits, repeat Steps 1-2 with differentBLOCKCHAIN and USDC_ADDRESS values
for your target blockchains. Check the
USDC contract addresses for the correct
values.
The delegate authorization remains valid until explicitly removed with the
removeDelegate()
method.Remove a delegate
Follow these steps to revoke a delegate’s authorization to sign burn intents on behalf of your depositor wallet. After removing a delegate, note that:- The delegate can no longer create new burn intents for the depositor wallet
- Burn intents that were already signed by the delegate remain valid and can still be executed onchain
- This ensures that burns may be executed safely even in the event of a revocation
- The Gateway API reflects revocations once they are finalized onchain
Step 1. Create the remove delegate script
Create a new file calledremove-delegate.ts in the root of your project and
add the following code. This is nearly identical to the add delegate script, but
calls
removeDelegate()
instead.
remove-delegate.ts