Counter with a custody wallet that
holds native USDC, then complete the full deploy pipeline.
Prerequisites
Before you begin, ensure that you’ve:- Installed Arc Foundry
- Installed Git
Step 1. Initialize a project
From your working directory, initialize a new project:src/, test/, script/, foundry.toml) and
a .gitignore that already excludes .env. The default Counter example is
not Arc-specific, so replace it with a custody wallet next.
1.1. Remove the Counter example
1.2. Add the custody wallet
Createsrc/CustodyWallet.sol with the following contract. It accepts native
USDC deposits, reports the balance through both the native (18-decimal) and
ERC-20 (6-decimal) interfaces, and lets only the owner move funds out either
path.
1.3. Add a basic test
Createtest/CustodyWallet.t.sol:
Step 2. Configure the RPC connection
Create a.env file in the project root with the Arc Testnet RPC URL:
Step 3. Test the contract
From yourhello-arc project directory, run the custody wallet tests against
Arc’s runtime before deploying:
--network arc flag catches Arc-specific issues that a generic EVM
simulator would miss. Use it when testing your own contracts, too.
Step 4. Set up your wallet
4.1. Create a wallet
Create a new wallet witharc-cast. If you already have a development wallet,
skip this and add your wallet’s private key to your .env file in step 4.2
instead:
4.2. Configure your .env
Add the private key and the same address as the contract owner, then reload:
4.3. Fund your wallet
Visit the Circle Faucet, select Arc Testnet, enter your wallet address, and request testnet USDC. Arc uses USDC for gas, so this balance covers deployment fees and the deposit you send to the custody wallet in step 6.Testnet USDC is for testing purposes only. You can’t use it in production.
Step 5. Deploy to Arc Testnet
5.1. Deploy the contract
Deploy to Arc Testnet. Pass your wallet address as the constructorinitialOwner so the same key can call release later:
src/CustodyWallet.sol:CustodyWallet with your own contract path and
name when deploying your own contracts.
After deployment completes, you’ll see output similar to:
Deployed to address from the output to your .env file and reload:
5.2. Verify the contract on Arc Testnet Explorer
Arc Testnet Explorer runs Blockscout, so you can publish your contract’s source code witharc-forge verify-contract and Foundry’s Blockscout verifier.
Verified contracts show a Contract tab on the explorer with source code,
ABI, and a read/write UI.
Run the verification command from your Foundry project root, using the same
compiler settings and constructor arguments you used to deploy:
Step 6. Interact with your contract
Confirm the deployment on the Arc Testnet Explorer by entering the transaction hash from step 5.1.6.1. Deposit native USDC
Send native USDC into the wallet (this hitsreceive). The example deposits
0.1 USDC (0.1ether in 18-decimal native units):
6.2. Read both USDC views
Native balance (18 decimals):0.1 USDC deposit returns 100000000000000000 (0.1e18) from balance()
and 100000 (0.1e6) from usdcBalance().
6.3. Release native USDC
Withdraw0.05 USDC back to your wallet with release. Only the owner can call
this path; an ERC-20 allowance does not limit it:
balance() call from step 6.2. The wallet should hold 0.05e18
native USDC.
6.4. Approve the ERC-20 outflow path
Grant an ERC-20 allowance so a spender can pull USDC through the token interface. Amounts here use 6 decimals (approve10000 = 0.01 USDC):
This example is intentionally small. For production, add events for deposits
and withdrawals,
transferOwnership, and tighter input checks. Native USDC
transfers also emit Arc’s system
EIP-7708 Transfer logs — see
USDC system events.If you encounter unexpected behavior after deploying, see Troubleshoot with
Arc Foundry.