From ebc2e5901aa6ac9f99186fa5dc0bf1c6ab2373fc Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Sun, 6 Feb 2022 13:39:00 -0500 Subject: [PATCH] fix: Updated full-deploy-verify task. --- tasks/helpers/utils.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tasks/helpers/utils.ts b/tasks/helpers/utils.ts index b5d6832..859f4f4 100644 --- a/tasks/helpers/utils.ts +++ b/tasks/helpers/utils.ts @@ -2,8 +2,8 @@ import '@nomiclabs/hardhat-ethers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { Contract, ContractTransaction } from 'ethers'; import fs from 'fs'; -import hre from 'hardhat'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { runtimeHRE } from '../full-deploy-verify'; export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; @@ -29,14 +29,18 @@ export async function deployContract(tx: any): Promise { return result; } -export async function deployWithVerify(tx: any, args: any, contractPath: string): Promise { +export async function deployWithVerify( + tx: any, + args: any, + contractPath: string +): Promise { const deployedContract = await deployContract(tx); let count = 0; let maxTries = 5; while (true) { try { console.log('Verifying contract at', deployedContract.address); - await hre.run('verify:verify', { + await runtimeHRE.run('verify:verify', { address: deployedContract.address, constructorArguments: args, contract: contractPath, @@ -54,7 +58,7 @@ export async function deployWithVerify(tx: any, args: any, contractPath: string) await delay(5000); } - return deployContract; + return deployedContract; } export async function initEnv(hre: HardhatRuntimeEnvironment): Promise {