diff --git a/deploy/1_setup.migration.ts b/deploy/1_setup.migration.ts index bc023f5..a9151da 100644 --- a/deploy/1_setup.migration.ts +++ b/deploy/1_setup.migration.ts @@ -1,20 +1,25 @@ import { ethers } from "hardhat"; -import { Deployer } from "@solarity/hardhat-migrate"; -import { Registration__factory, VotingFactory__factory, Voting__factory } from "@ethers-v6"; +import { Deployer, Reporter } from "@solarity/hardhat-migrate"; +import { Registration__factory, VotingFactory__factory, Voting__factory, VerifierMock__factory } from "@ethers-v6"; -export = async (deployer: Deployer) => { +export = async (deployer: Deployer, reporter: Reporter) => { const registration = await deployer.deploy(Registration__factory); const votingFactory = await deployer.deploy(VotingFactory__factory); const votingImpl = await deployer.deploy(Voting__factory); - const registationVerifier = ethers.hexlify(ethers.randomBytes(20)); - const votingVerifier = ethers.hexlify(ethers.randomBytes(20)); + const verifierMock = await deployer.deploy(VerifierMock__factory); + const icaoMasterTreeMerkleRoot = ethers.hexlify(ethers.randomBytes(32)); - await registration.__Registration_init(80, registationVerifier, icaoMasterTreeMerkleRoot); + await registration.__Registration_init(80, await verifierMock.getAddress(), icaoMasterTreeMerkleRoot); await votingFactory.__VotingFactory_init( await registration.getAddress(), await votingImpl.getAddress(), - votingVerifier, + await verifierMock.getAddress(), + ); + + Reporter.reportContracts( + ["VotingFactory", `${await votingFactory.getAddress()}`], + ["Registration", `${await registration.getAddress()}`], ); };