-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify contracts on Bellecour Blockscout(s) v5 & v6
- Loading branch information
1 parent
c2f6bfe
commit 764b477
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import fs from 'fs'; | ||
import hre, { deployments } from 'hardhat'; | ||
import path from 'path'; | ||
|
||
(async () => { | ||
const jsonExtension = '.json'; | ||
const contractNames = fs | ||
.readdirSync(path.resolve(__dirname, `../deployments/${hre.network.name}`)) | ||
.filter((file) => file.endsWith(jsonExtension)) | ||
.map((filePath) => filePath.replace(jsonExtension, '')); | ||
console.log(`Contracts to verify: ${contractNames}`); | ||
for (const contractName of contractNames) { | ||
console.log(`Verifying ${contractName}..`); | ||
const { address, args } = await deployments.get(contractName); | ||
await hre.run('verify:verify', { | ||
address, | ||
constructorArguments: args, | ||
}); | ||
} | ||
})(); |