Skip to main content
Deploy a contract to Arc Testnet and interact with it onchain. You’ll initialize a Foundry project, replace the default Counter with a custody wallet that holds native USDC, then complete the full deploy pipeline.

Prerequisites

Before you begin, ensure that you’ve:

Step 1. Initialize a project

From your working directory, initialize a new project:
This scaffolds a Foundry layout (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

Create src/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

Create test/CustodyWallet.t.sol:

Step 2. Configure the RPC connection

Create a .env file in the project root with the Arc Testnet RPC URL:
Load the variables into your shell:
Never commit your .env file to version control. Store private keys and sensitive variables securely.

Step 3. Test the contract

From your hello-arc project directory, run the custody wallet tests against Arc’s runtime before deploying:
The --network arc flag catches Arc-specific issues that a generic EVM simulator would miss. Use it when testing your own contracts, too.
Use arc-anvil --network arc to run a local Arc node during development. It supports forking testnet state and testing contract interactions manually before deploying.

Step 4. Set up your wallet

4.1. Create a wallet

Create a new wallet with arc-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:
The command returns an address and private key:
Keep your private key secure. Never share it or commit it to source control. Use environment variables or a secrets manager for any non-test deployment.

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 constructor initialOwner so the same key can call release later:
Replace 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:
Save the 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 with arc-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:
You can also submit source code manually from the contract verification page on the explorer if you didn’t deploy with Foundry.
After verification succeeds, open the deployed address on explorer.testnet.arc.io to confirm the Contract tab now shows the verified source and lets you call functions directly from the UI.

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 hits receive). The example deposits 0.1 USDC (0.1ether in 18-decimal native units):

6.2. Read both USDC views

Native balance (18 decimals):
ERC-20 balance (6 decimals) for the same funds:
A 0.1 USDC deposit returns 100000000000000000 (0.1e18) from balance() and 100000 (0.1e6) from usdcBalance().
On Arc, native USDC and the USDC ERC-20 interface share one balance. Amounts use 18 decimals on the native path and 6 decimals on the ERC-20 path. See Contract addresses.

6.3. Release native USDC

Withdraw 0.05 USDC back to your wallet with release. Only the owner can call this path; an ERC-20 allowance does not limit it:
Re-run the balance() call from step 6.2. The wallet should hold 0.05e18 native USDC.
On Arc, native USDC has no allowance layer. A public function that forwards value can empty the contract even when release is owner-only:
Treat every call{value: …} path as a withdrawal and authorize it explicitly.

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 (approve 10000 = 0.01 USDC):
Confirm the allowance on the USDC contract:
approve only gates ERC-20 transferFrom. It does not control native release calls. Guard every outbound path on contracts that hold 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.
You now have a working deployment pipeline on Arc Testnet. To deploy production-ready tokens or NFTs without writing Solidity, see Deploy contracts.
If you encounter unexpected behavior after deploying, see Troubleshoot with Arc Foundry.