Skip to content

Commit b74c958

Browse files
authored
Merge pull request #616 from VenusProtocol/fix/etherscan-verify
[VPD-74] Etherscan V2 Integration
2 parents 8d98b33 + 5046e28 commit b74c958

File tree

4 files changed

+27
-114
lines changed

4 files changed

+27
-114
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $ yarn hardhat --network <network-name> --export ./deployments/<network-name>.js
130130
### Source Code Verification
131131

132132
In order to verify the source code of already deployed contracts, run:
133-
`npx hardhat etherscan-verify --network <network_name>`
133+
`npx hardhat verify --network <network-name> <contract-address> <constructor-arg1> <constructor-arg2>`
134134

135135
Make sure you have added `ETHERSCAN_API_KEY` in `.env` file.
136136

hardhat.config.ts

Lines changed: 5 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import "module-alias/register";
22

33
import "@nomicfoundation/hardhat-chai-matchers";
4+
import "@nomicfoundation/hardhat-verify";
45
import "@nomiclabs/hardhat-ethers";
5-
import "@nomiclabs/hardhat-etherscan";
66
import "@openzeppelin/hardhat-upgrades";
77
import "@typechain/hardhat";
88
import fs from "fs";
@@ -258,56 +258,12 @@ const config: HardhatUserConfig = {
258258
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
259259
},
260260
},
261+
sourcify: {
262+
enabled: true,
263+
},
261264
etherscan: {
262-
apiKey: {
263-
bscmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
264-
bsctestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
265-
sepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
266-
ethereum: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
267-
opbnbtestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
268-
opbnbmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
269-
arbitrumsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
270-
arbitrumone: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
271-
opsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
272-
opmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
273-
basesepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
274-
basemainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
275-
unichainsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
276-
unichainmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
277-
},
265+
apiKey: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
278266
customChains: [
279-
{
280-
network: "bscmainnet",
281-
chainId: 56,
282-
urls: {
283-
apiURL: "https://api.bscscan.com/api",
284-
browserURL: "https://bscscan.com",
285-
},
286-
},
287-
{
288-
network: "bsctestnet",
289-
chainId: 97,
290-
urls: {
291-
apiURL: "https://api-testnet.bscscan.com/api",
292-
browserURL: "https://testnet.bscscan.com",
293-
},
294-
},
295-
{
296-
network: "sepolia",
297-
chainId: 11155111,
298-
urls: {
299-
apiURL: "https://api-sepolia.etherscan.io/api",
300-
browserURL: "https://sepolia.etherscan.io",
301-
},
302-
},
303-
{
304-
network: "ethereum",
305-
chainId: 1,
306-
urls: {
307-
apiURL: "https://api.etherscan.io/api",
308-
browserURL: "https://etherscan.io",
309-
},
310-
},
311267
{
312268
network: "opbnbtestnet",
313269
chainId: 5611,
@@ -324,22 +280,6 @@ const config: HardhatUserConfig = {
324280
browserURL: "https://opbnbscan.com/",
325281
},
326282
},
327-
{
328-
network: "arbitrumsepolia",
329-
chainId: 421614,
330-
urls: {
331-
apiURL: `https://api-sepolia.arbiscan.io/api`,
332-
browserURL: "https://sepolia.arbiscan.io/",
333-
},
334-
},
335-
{
336-
network: "arbitrumone",
337-
chainId: 42161,
338-
urls: {
339-
apiURL: `https://api.arbiscan.io/api/`,
340-
browserURL: "https://arbiscan.io/",
341-
},
342-
},
343283
{
344284
network: "opsepolia",
345285
chainId: 11155420,
@@ -348,30 +288,6 @@ const config: HardhatUserConfig = {
348288
browserURL: "https://sepolia-optimistic.etherscan.io/",
349289
},
350290
},
351-
{
352-
network: "opmainnet",
353-
chainId: 10,
354-
urls: {
355-
apiURL: "https://api-optimistic.etherscan.io/api",
356-
browserURL: "https://optimistic.etherscan.io/",
357-
},
358-
},
359-
{
360-
network: "basesepolia",
361-
chainId: 84532,
362-
urls: {
363-
apiURL: "https://api-sepolia.basescan.org/api",
364-
browserURL: "https://sepolia.basescan.org/",
365-
},
366-
},
367-
{
368-
network: "basemainnet",
369-
chainId: 8453,
370-
urls: {
371-
apiURL: "https://api.basescan.org/api",
372-
browserURL: "https://basescan.org/",
373-
},
374-
},
375291
{
376292
network: "unichainsepolia",
377293
chainId: 1301,

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"@matterlabs/hardhat-zksync-verify": "0.7.0",
6060
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
6161
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
62-
"@nomicfoundation/hardhat-verify": "^2.0.8",
63-
"@nomiclabs/hardhat-etherscan": "^3.1.0",
62+
"@nomicfoundation/hardhat-verify": "^2.0.14",
6463
"@openzeppelin/hardhat-upgrades": "^1.21.0",
6564
"@semantic-release/changelog": "^6.0.1",
6665
"@semantic-release/git": "^10.0.1",

yarn.lock

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,25 @@ __metadata:
16871687
languageName: node
16881688
linkType: hard
16891689

1690+
"@nomicfoundation/hardhat-verify@npm:^2.0.14":
1691+
version: 2.1.1
1692+
resolution: "@nomicfoundation/hardhat-verify@npm:2.1.1"
1693+
dependencies:
1694+
"@ethersproject/abi": ^5.1.2
1695+
"@ethersproject/address": ^5.0.2
1696+
cbor: ^8.1.0
1697+
debug: ^4.1.1
1698+
lodash.clonedeep: ^4.5.0
1699+
picocolors: ^1.1.0
1700+
semver: ^6.3.0
1701+
table: ^6.8.0
1702+
undici: ^5.14.0
1703+
peerDependencies:
1704+
hardhat: ^2.26.0
1705+
checksum: 11abc13105a85cfcedd6d6cd76c5fe57ab83543e6667e8006b7104cf10d97f05ed81d2a0ae8aa766e940346989b41983a0015805ac3d2f300255af05304ebe62
1706+
languageName: node
1707+
linkType: hard
1708+
16901709
"@nomicfoundation/hardhat-verify@npm:^2.0.8":
16911710
version: 2.0.12
16921711
resolution: "@nomicfoundation/hardhat-verify@npm:2.0.12"
@@ -1815,26 +1834,6 @@ __metadata:
18151834
languageName: node
18161835
linkType: hard
18171836

1818-
"@nomiclabs/hardhat-etherscan@npm:^3.1.0":
1819-
version: 3.1.8
1820-
resolution: "@nomiclabs/hardhat-etherscan@npm:3.1.8"
1821-
dependencies:
1822-
"@ethersproject/abi": ^5.1.2
1823-
"@ethersproject/address": ^5.0.2
1824-
cbor: ^8.1.0
1825-
chalk: ^2.4.2
1826-
debug: ^4.1.1
1827-
fs-extra: ^7.0.1
1828-
lodash: ^4.17.11
1829-
semver: ^6.3.0
1830-
table: ^6.8.0
1831-
undici: ^5.14.0
1832-
peerDependencies:
1833-
hardhat: ^2.0.4
1834-
checksum: 13864380d104705a54668adf2fb37a87d1147a064c1d29dbc356390e7254d5c7501b9b3af9c4ec2f9d9ff642a01417d5d35970d626fe706f5f4830820ae89ecb
1835-
languageName: node
1836-
linkType: hard
1837-
18381837
"@npmcli/agent@npm:^3.0.0":
18391838
version: 3.0.0
18401839
resolution: "@npmcli/agent@npm:3.0.0"
@@ -3427,8 +3426,7 @@ __metadata:
34273426
"@nomicfoundation/hardhat-chai-matchers": ^1.0.3
34283427
"@nomicfoundation/hardhat-ethers": ^3.0.0
34293428
"@nomicfoundation/hardhat-network-helpers": ^1.0.10
3430-
"@nomicfoundation/hardhat-verify": ^2.0.8
3431-
"@nomiclabs/hardhat-etherscan": ^3.1.0
3429+
"@nomicfoundation/hardhat-verify": ^2.0.14
34323430
"@openzeppelin/contracts": 4.9.3
34333431
"@openzeppelin/contracts-upgradeable": ^4.8.0
34343432
"@openzeppelin/hardhat-upgrades": ^1.21.0

0 commit comments

Comments
 (0)