diff --git a/scripts/deployment/deployConnector.ts b/scripts/deployment/deployConnector.ts index e23d9adb..1d35e728 100644 --- a/scripts/deployment/deployConnector.ts +++ b/scripts/deployment/deployConnector.ts @@ -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; }; diff --git a/scripts/deployment/deployConnectorsFromCmd.ts b/scripts/deployment/deployConnectorsFromCmd.ts index 0a1375f0..d45548c3 100644 --- a/scripts/deployment/deployConnectorsFromCmd.ts +++ b/scripts/deployment/deployConnectorsFromCmd.ts @@ -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) => {