diff --git a/contracts/tasks/deploy/maci/10-maci.ts b/contracts/tasks/deploy/maci/10-maci.ts index e974a6396f..a1b7b653a7 100644 --- a/contracts/tasks/deploy/maci/10-maci.ts +++ b/contracts/tasks/deploy/maci/10-maci.ts @@ -1,4 +1,4 @@ -import type { EASGatekeeper } from "../../../typechain-types"; +import type { EASGatekeeper, MACI } from "../../../typechain-types"; import { ContractStorage } from "../../helpers/ContractStorage"; import { Deployment } from "../../helpers/Deployment"; @@ -8,6 +8,7 @@ const deployment = Deployment.getInstance(); const storage = ContractStorage.getInstance(); const DEFAULT_STATE_TREE_DEPTH = 10; +const STATE_TREE_SUBDEPTH = 2; /** * Deploy step registration and task itself @@ -57,7 +58,7 @@ deployment const stateTreeDepth = deployment.getDeployConfigField(EContracts.MACI, "stateTreeDepth") ?? DEFAULT_STATE_TREE_DEPTH; - const maciContract = await deployment.deployContractWithLinkedLibraries( + const maciContract = await deployment.deployContractWithLinkedLibraries( maciContractFactory, pollFactoryContractAddress, messageProcessorFactoryContractAddress, @@ -94,4 +95,15 @@ deployment ], network: hre.network.name, }); + + const accQueueAddress = await maciContract.stateAq(); + const accQueue = await deployment.getContract({ name: EContracts.AccQueue, address: accQueueAddress }); + + await storage.register({ + id: EContracts.AccQueue, + name: "contracts/trees/AccQueueQuinaryBlankSl.sol:AccQueueQuinaryBlankSl", + contract: accQueue, + args: [STATE_TREE_SUBDEPTH], + network: hre.network.name, + }); }); diff --git a/contracts/tasks/helpers/ContractStorage.ts b/contracts/tasks/helpers/ContractStorage.ts index 38220a8157..1502a97b2d 100644 --- a/contracts/tasks/helpers/ContractStorage.ts +++ b/contracts/tasks/helpers/ContractStorage.ts @@ -59,7 +59,7 @@ export class ContractStorage { * * @param {IRegisterContract} args - register arguments */ - async register({ id, key, contract, network, args }: IRegisterContract): Promise { + async register({ id, key, contract, network, args, name }: IRegisterContract): Promise { const contractAddress = await contract.getAddress(); const deploymentTx = contract.deploymentTransaction(); @@ -84,6 +84,7 @@ export class ContractStorage { if (args !== undefined) { logEntry.verify = { + name, args: JSON.stringify(args), }; } diff --git a/contracts/tasks/helpers/ContractVerifier.ts b/contracts/tasks/helpers/ContractVerifier.ts index b98d410184..8003899aab 100644 --- a/contracts/tasks/helpers/ContractVerifier.ts +++ b/contracts/tasks/helpers/ContractVerifier.ts @@ -27,10 +27,16 @@ export class ContractVerifier { * @param libraries - stringified libraries which can't be detected automatically * @returns */ - async verify(address: string, constructorArguments: string, libraries?: string): Promise<[boolean, string]> { + async verify( + address: string, + constructorArguments: string, + contract?: string, + libraries?: string, + ): Promise<[boolean, string]> { const params: IVerificationSubtaskArgs = { address, constructorArguments: JSON.parse(constructorArguments) as unknown[], + contract, }; if (libraries) { diff --git a/contracts/tasks/helpers/types.ts b/contracts/tasks/helpers/types.ts index 66c1f117ce..6532ddf0a5 100644 --- a/contracts/tasks/helpers/types.ts +++ b/contracts/tasks/helpers/types.ts @@ -457,6 +457,7 @@ export interface IStorageInstanceEntry { */ verify?: { args?: string; + name?: string; impl?: string; subType?: string; }; @@ -490,6 +491,11 @@ export interface IRegisterContract { * Group key for same contracts */ key?: BigNumberish; + + /** + * Contract name with path specified + */ + name?: string; } /** diff --git a/contracts/tasks/runner/verifyFull.ts b/contracts/tasks/runner/verifyFull.ts index 1aa97bd7b9..1b6e84492b 100644 --- a/contracts/tasks/runner/verifyFull.ts +++ b/contracts/tasks/runner/verifyFull.ts @@ -60,7 +60,7 @@ task("verify-full", "Verify contracts listed in storage") console.log("Already verified"); } else { // eslint-disable-next-line no-await-in-loop - const [ok, err] = await verifier.verify(address, params?.args ?? ""); + const [ok, err] = await verifier.verify(address, params?.args ?? "", params?.name); if (ok) { storage.setVerified(address, hre.network.name, true);