Skip to content

Commit f1b0883

Browse files
Merge pull request #229 from BitGo/WIN-6097-upgrade-hardhat
chore: upgrade hardhat to take advantage of verify:verify for etherscan v2
2 parents 1db986c + 7e5cd35 commit f1b0883

File tree

6 files changed

+5638
-6198
lines changed

6 files changed

+5638
-6198
lines changed

.github/workflows/deploy_and_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Use Node.js
8383
uses: actions/setup-node@v3
8484
with:
85-
node-version: 16.x
85+
node-version: 18.x
8686
cache: 'npm'
8787
- run: npm install
8888
- run: npm run deploy-test --network ${{ needs.get-network.outputs.network }}
@@ -163,7 +163,7 @@ jobs:
163163
- name: Use Node.js
164164
uses: actions/setup-node@v3
165165
with:
166-
node-version: 16.x
166+
node-version: 18.x
167167
cache: 'npm'
168168
- run: npm install
169169
- run: npm run deploy-prod --network ${{ needs.get-network.outputs.network }}

.github/workflows/deploy_batcher_contract.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- name: Use Node.js
8686
uses: actions/setup-node@v4
8787
with:
88-
node-version: 16.x
88+
node-version: 18.x
8989
cache: 'npm'
9090
- run: npm install
9191
- run: npm run deploy-batcher --network ${{ needs.get-network.outputs.network }}
@@ -144,7 +144,7 @@ jobs:
144144
- name: Use Node.js
145145
uses: actions/setup-node@v4
146146
with:
147-
node-version: 16.x
147+
node-version: 18.x
148148
cache: 'npm'
149149
- run: npm install
150150
- run: npm run deploy-batcher --network ${{ needs.get-network.outputs.network }}

deployUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export async function waitAndVerify(
129129
logger.info(
130130
`Waiting for ${confirmationCount} block confirmations for ${contractName}...`
131131
);
132+
const artifact = await hre.artifacts.readArtifact(contractName);
133+
const verificationString = `${artifact.sourceName}:${artifact.contractName}`;
134+
console.log(`Verification string: ${verificationString}`);
132135
await contract.deployTransaction.wait(confirmationCount);
133136
logger.success(`Contract confirmed on the network at ${contract.address}.`);
134137

@@ -142,7 +145,8 @@ export async function waitAndVerify(
142145
logger.info('Attempting verification with standard Hardhat verifier...');
143146
await hre.run('verify:verify', {
144147
address: contract.address,
145-
constructorArguments
148+
constructorArguments: constructorArguments,
149+
contract: verificationString
146150
});
147151
logger.success('Standard verification successful!');
148152
return; // Success, exit the loop.

hardhat.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as dotenv from 'dotenv';
22
dotenv.config();
3-
import '@nomiclabs/hardhat-etherscan';
43
import { HardhatUserConfig } from 'hardhat/config';
5-
import '@nomiclabs/hardhat-etherscan';
4+
import '@nomicfoundation/hardhat-verify';
65
import '@nomiclabs/hardhat-waffle';
76
import '@nomiclabs/hardhat-truffle5';
87
import '@typechain/hardhat';

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"solc": "0.8.20"
4444
},
4545
"devDependencies": {
46+
"@nomicfoundation/hardhat-verify": "^2.0.14",
4647
"@nomiclabs/hardhat-ethers": "^2.0.4",
47-
"@nomiclabs/hardhat-etherscan": "^3.1.0",
4848
"@nomiclabs/hardhat-truffle5": "^2.0.3",
4949
"@nomiclabs/hardhat-waffle": "^2.0.2",
5050
"@nomiclabs/hardhat-web3": "^2.0.0",
@@ -82,7 +82,7 @@
8282
"web3": "^1.7.0"
8383
},
8484
"engines": {
85-
"node": ">=16 <17",
85+
"node": ">=18",
8686
"npm": ">=7"
8787
}
8888
}

0 commit comments

Comments
 (0)