From f1907a542e3c1c298d820c317188f2c7c35ca1f4 Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Thu, 30 Dec 2021 17:54:29 +0100 Subject: [PATCH] Fix proposal tasks --- src/tasks/proposals.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/tasks/proposals.ts b/src/tasks/proposals.ts index faca681..606887b 100644 --- a/src/tasks/proposals.ts +++ b/src/tasks/proposals.ts @@ -37,8 +37,7 @@ task("addProposal", "Adds a proposal question") .addParam("proposalFile", "File with proposal information json", undefined, types.inputFile) .setAction(async (taskArgs, hardhatRuntime) => { const ethers = hardhatRuntime.ethers; - const Module = await ethers.getContractFactory("RealityModule"); - const module = await Module.attach(taskArgs.module); + const module = await ethers.getContractAt("RealityModule", taskArgs.module); const proposal = await getProposalDetails(module, taskArgs.proposalFile); @@ -51,8 +50,7 @@ task("showProposal", "Shows proposal question details") .addParam("proposalFile", "File with proposal information json", undefined, types.inputFile) .setAction(async (taskArgs, hardhatRuntime) => { const ethers = hardhatRuntime.ethers; - const Module = await ethers.getContractFactory("RealityModule"); - const module = await Module.attach(taskArgs.module); + const module = await ethers.getContractAt("RealityModule", taskArgs.module); const proposal = await getProposalDetails(module, taskArgs.proposalFile); @@ -71,8 +69,7 @@ task("executeProposal", "Executes a proposal") .addParam("proposalFile", "File with proposal information json", undefined, types.inputFile) .setAction(async (taskArgs, hardhatRuntime) => { const ethers = hardhatRuntime.ethers; - const Module = await ethers.getContractFactory("RealityModule"); - const module = await Module.attach(taskArgs.module); + const module = await ethers.getContractAt("RealityModule", taskArgs.module); const proposal = await getProposalDetails(module, taskArgs.proposalFile);