Skip to content

Commit dd917e2

Browse files
roksoericglau
andauthored
Updates to support contract verification via etherscan V2 API (#1166)
Co-authored-by: Eric Lau <[email protected]>
1 parent 89a4e9a commit dd917e2

File tree

4 files changed

+264
-25
lines changed

4 files changed

+264
-25
lines changed

.changeset/witty-zebras-fold.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@openzeppelin/hardhat-upgrades': patch
3+
---
4+
5+
Support contract verification via etherscan V2 API.
6+
- **Potentially breaking changes**: Changes peer dependencies to the following:
7+
- `"@nomicfoundation/hardhat-ethers": "^3.0.6"`
8+
- `"@nomicfoundation/hardhat-verify": "^2.0.14"`
9+
- `"hardhat": "^2.24.1"`

packages/plugin-hardhat/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"test:watch": "fgbg 'bash scripts/test.sh --watch' 'tsc -b --watch' --"
2121
},
2222
"devDependencies": {
23-
"@nomicfoundation/hardhat-ethers": "^3.0.5",
24-
"@nomicfoundation/hardhat-verify": "^2.0.0",
23+
"@nomicfoundation/hardhat-ethers": "^3.0.6",
24+
"@nomicfoundation/hardhat-verify": "^2.0.14",
2525
"@openzeppelin/contracts": "5.3.0",
2626
"@openzeppelin/contracts-upgradeable": "5.3.0",
2727
"@types/mocha": "^7.0.2",
2828
"ava": "^6.0.0",
2929
"fgbg": "^0.1.4",
30-
"hardhat": "^2.19.1",
30+
"hardhat": "^2.24.1",
3131
"promisified": "^0.5.0",
3232
"proxyquire": "^2.1.3",
3333
"rimraf": "^5.0.0",
@@ -45,10 +45,10 @@
4545
"undici": "^6.11.1"
4646
},
4747
"peerDependencies": {
48-
"@nomicfoundation/hardhat-ethers": "^3.0.0",
49-
"@nomicfoundation/hardhat-verify": "^2.0.0",
48+
"@nomicfoundation/hardhat-ethers": "^3.0.6",
49+
"@nomicfoundation/hardhat-verify": "^2.0.14",
5050
"ethers": "^6.6.0",
51-
"hardhat": "^2.0.2"
51+
"hardhat": "^2.24.1"
5252
},
5353
"peerDependenciesMeta": {
5454
"@nomicfoundation/hardhat-verify": {

packages/plugin-hardhat/src/utils/etherscan-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Etherscan } from '@nomicfoundation/hardhat-verify/etherscan';
1414
* @returns The Etherscan API response
1515
*/
1616
export async function callEtherscanApi(etherscan: Etherscan, params: any): Promise<EtherscanResponseBody> {
17-
const parameters = { ...params, apikey: etherscan.apiKey };
17+
const parameters = { ...params, apikey: etherscan.apiKey, chainid: etherscan.chainId };
1818
const response = await request(etherscan.apiUrl, {
1919
method: 'POST',
2020
query: parameters,

0 commit comments

Comments
 (0)