From 45ed8199194a46054e709ebd3a19f8f1f14ea935 Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:33:11 +0100 Subject: [PATCH] fix(contracts): ensure we call setMaci when deploying semaphoreGatekeeper (#1647) --- contracts/tasks/deploy/maci/08-maci.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/contracts/tasks/deploy/maci/08-maci.ts b/contracts/tasks/deploy/maci/08-maci.ts index 504e97c6fc..679fb5cca3 100644 --- a/contracts/tasks/deploy/maci/08-maci.ts +++ b/contracts/tasks/deploy/maci/08-maci.ts @@ -1,4 +1,10 @@ -import type { EASGatekeeper, GitcoinPassportGatekeeper, ZupassGatekeeper, MACI } from "../../../typechain-types"; +import type { + EASGatekeeper, + GitcoinPassportGatekeeper, + ZupassGatekeeper, + MACI, + SemaphoreGatekeeper, +} from "../../../typechain-types"; import { ContractStorage } from "../../helpers/ContractStorage"; import { Deployment } from "../../helpers/Deployment"; @@ -87,6 +93,14 @@ deployment.deployTask("full:deploy-maci", "Deploy MACI contract").then((task) => name: EContracts.ZupassGatekeeper, address: gatekeeperContractAddress, }); + const maciInstanceAddress = await maciContract.getAddress(); + await gatekeeperContract.setMaciInstance(maciInstanceAddress).then((tx) => tx.wait()); + } else if (gatekeeper === EContracts.SemaphoreGatekeeper) { + const gatekeeperContract = await deployment.getContract({ + name: EContracts.SemaphoreGatekeeper, + address: gatekeeperContractAddress, + }); + const maciInstanceAddress = await maciContract.getAddress(); await gatekeeperContract.setMaciInstance(maciInstanceAddress).then((tx) => tx.wait()); }