A minimal Hardhat project demonstrating how to deploy and verify a Solidity smart contract on ArcScan, the block explorer for the Arc testnet.
contracts/HelloARC.sol — the contract
scripts/deploy.js — deployment script
gw.js — utility to generate a fresh wallet
hardhat.config.js — Hardhat config pointing at Arc testnet
.env — private key and RPC URL (never commit this)
1. Install dependencies
npm install2. Configure environment
Create a .env file in the project root (one already exists as a template):
PRIVATE_KEY=0x<your-private-key>
ARC_RPC_URL=https://rpc.testnet.arc.network
To generate a fresh wallet:
node gw.jsCopy the printed private key into .env. Then fund the address with testnet USDC from the Arc faucet before deploying.
npx hardhat run scripts/deploy.js --network arcTestnetThe output will look like:
Deploying HelloARC to ARC Testnet...
Deployer: 0xYourAddress
Contract deployed to: 0xDeployedContractAddress
ArcScan: https://testnet.arcscan.app/address/0xDeployedContractAddress
Save the contract address — you will need it for verification.
ArcScan's manual verification form requires a single self-contained source file. Hardhat's flatten command merges all imports into one file and deduplicates SPDX-License-Identifier headers:
npx hardhat flatten contracts/HelloARC.sol > HelloARC_flat.solThe flattened file is already included in this repo as HelloARC_flat.sol.
Open the contract page on ArcScan:
https://testnet.arcscan.app/address/<your-contract-address>
Click Contract → Verify and Publish, then fill in the form as follows.
| Field | Value | Where to find it |
|---|---|---|
| Contract Address | 0x... (your deployed address) |
Printed by deploy.js at deploy time |
| Contract Name | HelloARC |
Must match the contract name in HelloARC.sol |
| Compiler Version | v0.8.20+commit.a1b79de6 |
hardhat.config.js → solidity.version |
| EVM Version | paris |
hardhat.config.js → settings.evmVersion |
| Optimization Enabled | Yes |
hardhat.config.js → settings.optimizer.enabled |
| Optimization Runs | 200 |
hardhat.config.js → settings.optimizer.runs |
| Source Code | (paste full contents of HelloARC_flat.sol) |
Generated by the flatten command above |
| Constructor Arguments | (ABI-encoded form of "Hello, ARC!") |
See note below |
HelloARC takes one string argument. When deployed via deploy.js, it is called with "Hello, ARC!". ArcScan expects this ABI-encoded as a hex string (without 0x):
0000000000000000000000000000000000000000000000000000000000000020
000000000000000000000000000000000000000000000000000000000000000b
48656c6c6f2c204152432100000000000000000000000000000000000000000
You can generate this for any value using ethers:
const { ethers } = require("ethers");
const encoded = ethers.AbiCoder.defaultAbiCoder().encode(["string"], ["Hello, ARC!"]);
console.log(encoded.slice(2)); // strip leading 0xIf you deployed with a different message, re-encode with that string.
Click Verify and Publish. If the bytecode matches, ArcScan will mark the contract as verified and display the source code, ABI, and read/write interface on the contract page.
These are the exact settings used to compile HelloARC.sol. They must match what you enter in the verification form.
// hardhat.config.js
solidity: {
version: '0.8.20',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'paris',
},
},