added verify connector support

This commit is contained in:
pradyuman-verma 2021-12-26 13:17:07 +05:30
parent fd9c72eafb
commit 7f9853bb42
No known key found for this signature in database
GPG Key ID: E36FD6BC8923221F
2 changed files with 19 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import { ethers } from "hardhat";
import hre, { ethers } from "hardhat";
export const deployConnector = async (connectorName?: string) => {
connectorName = String(process.env.connectorName) ?? connectorName;
@ -7,5 +7,16 @@ export const deployConnector = async (connectorName?: string) => {
await connector.deployed();
console.log(`${connectorName} Deployed: ${connector.address}`);
try {
await hre.run("verify:verify", {
address: connector.address,
constructorArguments: [],
});
} catch (error) {
console.log(`Failed to verify: ${connectorName}@${connector.address}`);
console.log(error);
console.log();
}
return connector.address;
};

View File

@ -3,6 +3,8 @@ import inquirer from "inquirer";
import { connectors, connectMapping } from "./connectors";
import { join } from "path";
let start: number, end: number;
async function deployRunner() {
const { chain } = await inquirer.prompt([
{
@ -23,7 +25,7 @@ async function deployRunner() {
]);
connector = connectMapping[connector];
start = Date.now();
await execScript({
cmd: "npx",
args: ["hardhat", "run", "scripts/deployment/deploy.ts"],
@ -32,6 +34,7 @@ async function deployRunner() {
networkType: chain,
},
});
end = Date.now();
}
// let args = process.argv;
@ -138,7 +141,9 @@ async function deployRunner() {
deployRunner()
.then(() => {
console.log("Done successfully");
console.log(
`Done successfully, total time taken: ${(end - start) / 1000} sec`
);
process.exit(0);
})
.catch((err) => {