Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@ The genesis builder (`contracts/scripts/ArtifactHelper.s.sol`), all CREATE2-sens
tests (`tests/localdev/genesis.test.ts`) all read from `contracts/out/forge/`.
Hardhat's compile output is **not** consumed for any CREATE2-sensitive path.

## Verifying contracts on Arcscan

Arc Testnet's explorer ([testnet.arcscan.app](https://testnet.arcscan.app)) exposes an
**Etherscan-compatible** contract verification API at `https://testnet.arcscan.app/api`.
Blockscout-native field names (`addressHash`, `name`, `contractSourceCode`, …) are **not**
accepted and return a misleading `Missing codeformat field` error even when `codeformat` is
present — that is the failure mode reported in #210. Use Etherscan V1 field names
(`contractaddress`, `contractname`, `sourceCode`, `codeformat`, …) or a tool that already
speaks that dialect.

### Foundry

Arcscan ignores the API key value but Foundry still requires a non-empty key:

```bash
export ARC_TESTNET_RPC_URL=https://rpc.testnet.arc.io
forge verify-contract <address> path/to/Contract.sol:ContractName \
--chain 5042002 \
--verifier custom \
--verifier-url https://testnet.arcscan.app/api \
--verifier-api-key empty \
--watch
```

Pass constructor args with `--constructor-args` / `--constructor-args-path` when needed.
`foundry.toml` also registers an `arc_testnet` Etherscan entry so `--chain arc-testnet` (or `5042002`) works
once `ETHERSCAN_API_KEY` (any non-empty string) is set.

### Hardhat

```bash
export ARC_TESTNET_RPC_URL=https://rpc.testnet.arc.io
npx hardhat verify --network testnet <address> [constructorArgs...]
```

This requires `@nomicfoundation/hardhat-verify` with an Arc Testnet `customChains` /
`etherscan` entry for chain ID `5042002` pointing at `https://testnet.arcscan.app/api`
(see open wiring in related PRs if it is not yet on `main`). Disable Sourcify so it does not
race Arcscan.

## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
Expand Down
5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ fs_permissions = [
[lint]
ignore = ["contracts/test/scripts/*.t.sol"]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

# Arcscan is Blockscout-backed but speaks the Etherscan V1 verify API (see #210).
# A non-empty key is required by Foundry; Arcscan ignores the value.
[etherscan]
arc_testnet = { key = "${ETHERSCAN_API_KEY}", chain = 5042002, url = "https://testnet.arcscan.app/api" }