Counter contract to complete the full
deploy pipeline before developing your own contracts.
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/Counter.sol, a matching test file at test/Counter.t.sol,
and a deployment script at script/Counter.s.sol. The generated .gitignore
already excludes .env from version control.
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 Counter 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 to your .env file and 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 your deployment fees.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:src/Counter.sol:Counter 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 you used to deploy:
arc-cast abi-encode and pass the result with --constructor-args. For
example:
Step 6. Interact with your contract
Confirm the deployment on the Arc Testnet Explorer by entering the transaction hash from step 5.1. Read the current counter value witharc-cast call:
Counter returns 0. Increment it onchain with
arc-cast send:
arc-cast call command. The returned value is now 1.
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.