-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()}`], | ||
); | ||
}; |