Arc is currently in its testnet phase. During this period, the network may
experience instability or unplanned downtime. Note: Throughout this page,
all references to Arc refer specifically to the Arc Testnet.
Counter contract on the Arc Testnet. forge init
scaffolds a working Solidity project — contract, tests, and deployment script —
so you can ship to Arc without writing any new contract code. By the end, you’ll
have configured Foundry for Arc, deployed Counter, and called it from the
command line with cast.
Prerequisites
Before you begin, ensure you have:- Access to a Unix-like shell (macOS, Linux, or Windows with WSL)
- Installed
curl(used by the Foundry installer) - Installed a code editor such as VS Code
Step 1. Set up Foundry
Install Foundry’s command-line tools (forge, cast, anvil, chisel):
src/Counter.sol, a matching test file at test/Counter.t.sol,
and a deployment script at script/Counter.s.sol.
Step 2. Configure Foundry for Arc
Create a.env file in the project root with the Arc Testnet RPC URL:
Step 3. Test the contract
Run the included tests to compile the contract and verify it works locally:Counter tests pass, confirming compilation and local correctness.
Step 4. Deploy to Arc Testnet
4.1. Create and fund a wallet
Generate a new keypair withcast:
.env file and reload:
Testnet USDC is for testing purposes only. It has no real-world value and must
not be used in production.
4.2. Deploy the contract
DeployCounter to Arc Testnet:
.env file and reload:
Step 5. Interact with your contract
Confirm the deployment on the Arc Testnet Explorer by pasting the transaction hash from the previous step. Read the current counter value withcast call:
Counter returns 0. Increment it onchain with cast send:
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.