Skip to content

Commit f6b2bb0

Browse files
authored
Merge pull request #15 from VenusProtocol/fix/contract-verification
[VPD-74] Etherscan V2 Integration
2 parents 55f196e + 9f0293e commit f6b2bb0

File tree

3 files changed

+24
-147
lines changed

3 files changed

+24
-147
lines changed

hardhat.config.ts

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

33
import "@nomicfoundation/hardhat-chai-matchers";
4-
import "@nomicfoundation/hardhat-toolbox";
4+
import "@nomicfoundation/hardhat-verify";
55
import "@nomiclabs/hardhat-ethers";
6-
import "@nomiclabs/hardhat-etherscan";
76
import "@openzeppelin/hardhat-upgrades";
87
import "@typechain/hardhat";
98
import * as dotenv from "dotenv";
@@ -218,40 +217,11 @@ const config: HardhatUserConfig = {
218217
enabled: process.env.REPORT_GAS !== undefined,
219218
currency: "USD",
220219
},
220+
sourcify: {
221+
enabled: true,
222+
},
221223
etherscan: {
222224
customChains: [
223-
{
224-
network: "bsctestnet",
225-
chainId: 97,
226-
urls: {
227-
apiURL: "https://api-testnet.bscscan.com/api",
228-
browserURL: "https://testnet.bscscan.com",
229-
},
230-
},
231-
{
232-
network: "bscmainnet",
233-
chainId: 56,
234-
urls: {
235-
apiURL: "https://api.bscscan.com/api",
236-
browserURL: "https://bscscan.com",
237-
},
238-
},
239-
{
240-
network: "sepolia",
241-
chainId: 11155111,
242-
urls: {
243-
apiURL: "https://api-sepolia.etherscan.io/api",
244-
browserURL: "https://sepolia.etherscan.io",
245-
},
246-
},
247-
{
248-
network: "ethereum",
249-
chainId: 1,
250-
urls: {
251-
apiURL: "https://api.etherscan.io/api",
252-
browserURL: "https://etherscan.io",
253-
},
254-
},
255225
{
256226
network: "opbnbtestnet",
257227
chainId: 5611,
@@ -268,30 +238,6 @@ const config: HardhatUserConfig = {
268238
browserURL: "https://opbnbscan.com/",
269239
},
270240
},
271-
{
272-
network: "ethereum",
273-
chainId: 1,
274-
urls: {
275-
apiURL: "https://api.etherscan.io/api",
276-
browserURL: "https://etherscan.io",
277-
},
278-
},
279-
{
280-
network: "arbitrumsepolia",
281-
chainId: 421614,
282-
urls: {
283-
apiURL: `https://api-sepolia.arbiscan.io/api`,
284-
browserURL: "https://sepolia.arbiscan.io/",
285-
},
286-
},
287-
{
288-
network: "arbitrumone",
289-
chainId: 42161,
290-
urls: {
291-
apiURL: `https://api.arbiscan.io/api/`,
292-
browserURL: "https://arbiscan.io/",
293-
},
294-
},
295241
{
296242
network: "opsepolia",
297243
chainId: 11155420,
@@ -300,63 +246,24 @@ const config: HardhatUserConfig = {
300246
browserURL: "https://sepolia-optimistic.etherscan.io/",
301247
},
302248
},
303-
{
304-
network: "opmainnet",
305-
chainId: 10,
306-
urls: {
307-
apiURL: "https://api-optimistic.etherscan.io/api",
308-
browserURL: "https://optimistic.etherscan.io/",
309-
},
310-
},
311-
{
312-
network: "basesepolia",
313-
chainId: 84532,
314-
urls: {
315-
apiURL: "https://api-sepolia.basescan.org/api",
316-
browserURL: "https://sepolia.basescan.org/",
317-
},
318-
},
319-
{
320-
network: "basemainnet",
321-
chainId: 8453,
322-
urls: {
323-
apiURL: "https://api.basescan.org/api",
324-
browserURL: "https://basescan.org/",
325-
},
326-
},
327249
{
328250
network: "unichainsepolia",
329251
chainId: 1301,
330252
urls: {
331-
apiURL: "https://api-sepolia.uniscan.xyz/api/",
253+
apiURL: `https://api-sepolia.uniscan.xyz/api/`,
332254
browserURL: "https://sepolia.uniscan.xyz/",
333255
},
334256
},
335257
{
336258
network: "unichainmainnet",
337259
chainId: 130,
338260
urls: {
339-
apiURL: "https://api.uniscan.xyz/api/",
261+
apiURL: `https://api.uniscan.xyz/api/`,
340262
browserURL: "https://uniscan.xyz/",
341263
},
342264
},
343265
],
344-
apiKey: {
345-
bscmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
346-
bsctestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
347-
ethereum: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
348-
sepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
349-
opbnbmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
350-
opbnbtestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
351-
arbitrumone: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
352-
arbitrumsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
353-
opsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
354-
opmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
355-
basesepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
356-
basemainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
357-
unichainsepolia: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
358-
unichainmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
359-
},
266+
apiKey: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
360267
},
361268
paths: {
362269
tests: "./tests",

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
"@matterlabs/hardhat-zksync-verify": "0.7.0",
6464
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
6565
"@nomicfoundation/hardhat-network-helpers": "^1.0.4",
66-
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
67-
"@nomiclabs/hardhat-etherscan": "^3.0.3",
66+
"@nomicfoundation/hardhat-verify": "^2.0.14",
6867
"@semantic-release/changelog": "^6.0.1",
6968
"@semantic-release/git": "^10.0.1",
7069
"@semantic-release/npm": "^9.0.1",

yarn.lock

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,30 +1611,22 @@ __metadata:
16111611
languageName: node
16121612
linkType: hard
16131613

1614-
"@nomicfoundation/hardhat-toolbox@npm:^2.0.0":
1615-
version: 2.0.2
1616-
resolution: "@nomicfoundation/hardhat-toolbox@npm:2.0.2"
1614+
"@nomicfoundation/hardhat-verify@npm:^2.0.14":
1615+
version: 2.1.1
1616+
resolution: "@nomicfoundation/hardhat-verify@npm:2.1.1"
1617+
dependencies:
1618+
"@ethersproject/abi": ^5.1.2
1619+
"@ethersproject/address": ^5.0.2
1620+
cbor: ^8.1.0
1621+
debug: ^4.1.1
1622+
lodash.clonedeep: ^4.5.0
1623+
picocolors: ^1.1.0
1624+
semver: ^6.3.0
1625+
table: ^6.8.0
1626+
undici: ^5.14.0
16171627
peerDependencies:
1618-
"@ethersproject/abi": ^5.4.7
1619-
"@ethersproject/providers": ^5.4.7
1620-
"@nomicfoundation/hardhat-chai-matchers": ^1.0.0
1621-
"@nomicfoundation/hardhat-network-helpers": ^1.0.0
1622-
"@nomiclabs/hardhat-ethers": ^2.0.0
1623-
"@nomiclabs/hardhat-etherscan": ^3.0.0
1624-
"@typechain/ethers-v5": ^10.1.0
1625-
"@typechain/hardhat": ^6.1.2
1626-
"@types/chai": ^4.2.0
1627-
"@types/mocha": ">=9.1.0"
1628-
"@types/node": ">=12.0.0"
1629-
chai: ^4.2.0
1630-
ethers: ^5.4.7
1631-
hardhat: ^2.11.0
1632-
hardhat-gas-reporter: ^1.0.8
1633-
solidity-coverage: ^0.8.1
1634-
ts-node: ">=8.0.0"
1635-
typechain: ^8.1.0
1636-
typescript: ">=4.5.0"
1637-
checksum: a2eafb709acbabe40de4871c4e8684a03098f045dba4fc6c6e9281358d072f386a668488c109e2a36b8eade01dc4c4f9e8a76fa45c92591857c590c6e19f1ae7
1628+
hardhat: ^2.26.0
1629+
checksum: 11abc13105a85cfcedd6d6cd76c5fe57ab83543e6667e8006b7104cf10d97f05ed81d2a0ae8aa766e940346989b41983a0015805ac3d2f300255af05304ebe62
16381630
languageName: node
16391631
linkType: hard
16401632

@@ -1766,26 +1758,6 @@ __metadata:
17661758
languageName: node
17671759
linkType: hard
17681760

1769-
"@nomiclabs/hardhat-etherscan@npm:^3.0.3":
1770-
version: 3.1.8
1771-
resolution: "@nomiclabs/hardhat-etherscan@npm:3.1.8"
1772-
dependencies:
1773-
"@ethersproject/abi": ^5.1.2
1774-
"@ethersproject/address": ^5.0.2
1775-
cbor: ^8.1.0
1776-
chalk: ^2.4.2
1777-
debug: ^4.1.1
1778-
fs-extra: ^7.0.1
1779-
lodash: ^4.17.11
1780-
semver: ^6.3.0
1781-
table: ^6.8.0
1782-
undici: ^5.14.0
1783-
peerDependencies:
1784-
hardhat: ^2.0.4
1785-
checksum: 13864380d104705a54668adf2fb37a87d1147a064c1d29dbc356390e7254d5c7501b9b3af9c4ec2f9d9ff642a01417d5d35970d626fe706f5f4830820ae89ecb
1786-
languageName: node
1787-
linkType: hard
1788-
17891761
"@npmcli/agent@npm:^3.0.0":
17901762
version: 3.0.0
17911763
resolution: "@npmcli/agent@npm:3.0.0"
@@ -3360,9 +3332,8 @@ __metadata:
33603332
"@matterlabs/hardhat-zksync-verify": 0.7.0
33613333
"@nomicfoundation/hardhat-chai-matchers": ^1.0.3
33623334
"@nomicfoundation/hardhat-network-helpers": ^1.0.4
3363-
"@nomicfoundation/hardhat-toolbox": ^2.0.0
3335+
"@nomicfoundation/hardhat-verify": ^2.0.14
33643336
"@nomiclabs/hardhat-ethers": ^2.2.3
3365-
"@nomiclabs/hardhat-etherscan": ^3.0.3
33663337
"@openzeppelin/contracts": ^4.8.3
33673338
"@openzeppelin/contracts-upgradeable": ^4.8.3
33683339
"@openzeppelin/hardhat-upgrades": ^1.21.0

0 commit comments

Comments
 (0)