From 63eda8b5f5ac6cb0722e09bddebafea2c4d8d8fe Mon Sep 17 00:00:00 2001 From: airdropzamani Date: Sat, 12 Sep 2026 02:58:57 +0300 Subject: [PATCH] docs: wire Hardhat verify for Arcscan on Arc Testnet --- contracts/README.md | 14 ++++++++++++++ hardhat.config.ts | 22 +++++++++++++++++++++ package-lock.json | 47 ++++++++++++--------------------------------- package.json | 1 + 4 files changed, 49 insertions(+), 35 deletions(-) diff --git a/contracts/README.md b/contracts/README.md index d158c996..e13ffd03 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -12,6 +12,20 @@ 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)) is +Blockscout-based. The repo `hardhat.config.ts` already registers the Arc Testnet +chain for `@nomicfoundation/hardhat-verify`: + +```bash +npx hardhat verify --network testnet
[constructorArgs...] +``` + +Set `ARC_TESTNET_RPC_URL` before verifying. Foundry users can instead follow the +`arc-forge verify-contract` flow in the +[Deploy on Arc](https://docs.arc.io/arc/tutorials/deploy-on-arc) tutorial. + ## Foundry **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** diff --git a/hardhat.config.ts b/hardhat.config.ts index 98441dfe..6a9e6c39 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -17,6 +17,7 @@ import { HardhatUserConfig } from 'hardhat/config' import '@nomicfoundation/hardhat-foundry' import '@nomicfoundation/hardhat-toolbox-viem' +import '@nomicfoundation/hardhat-verify' import './tests/helpers/matchers/plugin' import './scripts/hardhat/tasks/genesis' @@ -79,6 +80,27 @@ const config: HardhatUserConfig = { mocha: { timeout: 20000, }, + // Arcscan is Blockscout-based. A non-empty apiKey is required by + // hardhat-verify even though Blockscout ignores the value. Sourcify is + // disabled so it does not race Arcscan verification. + etherscan: { + apiKey: { + arcTestnet: 'empty', + }, + customChains: [ + { + network: 'arcTestnet', + chainId: 5042002, + urls: { + apiURL: 'https://testnet.arcscan.app/api', + browserURL: 'https://testnet.arcscan.app', + }, + }, + ], + }, + sourcify: { + enabled: false, + }, paths: { sources: './contracts/src', tests: './tests', diff --git a/package-lock.json b/package-lock.json index 46a27481..87e630c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@noble/hashes": "^1.8.0", "@nomicfoundation/hardhat-foundry": "^1.2.0", "@nomicfoundation/hardhat-toolbox-viem": "^4.1.0", + "@nomicfoundation/hardhat-verify": "^2.1.3", "@nomicfoundation/hardhat-viem": "^2.1.0", "c-kzg": "^2.1.2", "eslint": "^9.32.0", @@ -1315,7 +1316,6 @@ "integrity": "sha512-danbGjPp2WBhLkJdQy9/ARM3WQIK+7vwzE0urNem1qZJjh9f54Kf5f1xuQv8DvqewUAkuPxVt/7q4Grz5WjqSg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@ethersproject/address": "^5.0.2", @@ -2306,7 +2306,6 @@ "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2449,7 +2448,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2793,7 +2791,6 @@ "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "nofilter": "^3.1.0" }, @@ -3970,8 +3967,7 @@ "url": "https://opencollective.com/fastify" } ], - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/fastq": { "version": "1.19.1", @@ -5360,8 +5356,7 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -5518,8 +5513,7 @@ "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -5540,8 +5534,7 @@ "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", @@ -6005,7 +5998,6 @@ "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12.19" } @@ -6662,7 +6654,6 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -7179,7 +7170,6 @@ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -7600,7 +7590,6 @@ "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -9222,7 +9211,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.3.tgz", "integrity": "sha512-danbGjPp2WBhLkJdQy9/ARM3WQIK+7vwzE0urNem1qZJjh9f54Kf5f1xuQv8DvqewUAkuPxVt/7q4Grz5WjqSg==", "dev": true, - "peer": true, "requires": { "@ethersproject/abi": "^5.1.2", "@ethersproject/address": "^5.0.2", @@ -9915,7 +9903,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dev": true, - "peer": true, "requires": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -10011,8 +9998,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true + "dev": true }, "async": { "version": "1.5.2", @@ -10272,7 +10258,6 @@ "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", "dev": true, - "peer": true, "requires": { "nofilter": "^3.1.0" } @@ -11106,8 +11091,7 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "dev": true, - "peer": true + "dev": true }, "fastq": { "version": "1.19.1", @@ -12065,8 +12049,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true + "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -12176,8 +12159,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true, - "peer": true + "dev": true }, "lodash.memoize": { "version": "4.1.2", @@ -12195,8 +12177,7 @@ "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true + "dev": true }, "log-symbols": { "version": "4.1.0", @@ -12538,8 +12519,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", - "dev": true, - "peer": true + "dev": true }, "nopt": { "version": "3.0.6", @@ -12980,8 +12960,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "peer": true + "dev": true }, "resolve": { "version": "1.17.0", @@ -13342,7 +13321,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, - "peer": true, "requires": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -13651,7 +13629,6 @@ "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", "dev": true, - "peer": true, "requires": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", diff --git a/package.json b/package.json index 67a58d6d..c47f17b4 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@noble/hashes": "^1.8.0", "@nomicfoundation/hardhat-foundry": "^1.2.0", "@nomicfoundation/hardhat-toolbox-viem": "^4.1.0", + "@nomicfoundation/hardhat-verify": "^2.1.3", "@nomicfoundation/hardhat-viem": "^2.1.0", "c-kzg": "^2.1.2", "eslint": "^9.32.0",