"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("@pcd/util");
const logger_1 = require("../../../ts/logger");
const constants_1 = require("../../helpers/constants");
const ContractStorage_1 = require("../../helpers/ContractStorage");
const Deployment_1 = require("../../helpers/Deployment");
const types_1 = require("../../helpers/types");
const deployment = Deployment_1.Deployment.getInstance();
const storage = ContractStorage_1.ContractStorage.getInstance();
/**
 * Deploy step registration and task itself
 */
deployment.deployTask(constants_1.EDeploySteps.Policies, "Deploy policies").then((task) => task.setAction(async ({ incremental }, hre) => {
    deployment.setHre(hre);
    const deployer = await deployment.getDeployer();
    const { deployFreeForAllSignUpPolicy, deployZupassSignUpPolicy, deployEASSignUpPolicy, deployGitcoinPassportPolicy, deployMerkleProofPolicy, deploySemaphoreSignupPolicy, deployHatsSignupPolicy, getDeployedPolicyProxyFactories, deployERC20VotesPolicy, deployERC20Policy, } = await Promise.resolve().then(() => __importStar(require("../../../ts/deploy")));
    const freeForAllPolicyContractAddress = storage.getAddress(types_1.EPolicies.FreeForAll, hre.network.name);
    const easPolicyContractAddress = storage.getAddress(types_1.EPolicies.EAS, hre.network.name);
    const hatsPolicyContractAddress = storage.getAddress(types_1.EPolicies.Hats, hre.network.name);
    const gitcoinPolicyContractAddress = storage.getAddress(types_1.EPolicies.GitcoinPassport, hre.network.name);
    const zupassPolicyContractAddress = storage.getAddress(types_1.EPolicies.Zupass, hre.network.name);
    const semaphorePolicyContractAddress = storage.getAddress(types_1.EPolicies.Semaphore, hre.network.name);
    const merkleProofPolicyContractAddress = storage.getAddress(types_1.EPolicies.MerkleProof, hre.network.name);
    const erc20VotesPolicyContractAddress = storage.getAddress(types_1.EPolicies.ERC20Votes, hre.network.name);
    const erc20PolicyContractAddress = storage.getAddress(types_1.EPolicies.ERC20, hre.network.name);
    const deployFreeForAllPolicy = deployment.getDeployConfigField(types_1.EContracts.FreeForAllPolicy, "deploy");
    const deployEASPolicy = deployment.getDeployConfigField(types_1.EContracts.EASPolicy, "deploy");
    const deployGitcoinPolicy = deployment.getDeployConfigField(types_1.EContracts.GitcoinPassportPolicy, "deploy");
    const deployZupassPolicy = deployment.getDeployConfigField(types_1.EContracts.ZupassPolicy, "deploy");
    const deploySemaphorePolicy = deployment.getDeployConfigField(types_1.EContracts.SemaphorePolicy, "deploy");
    const deployHatsSinglePolicy = deployment.getDeployConfigField(types_1.EContracts.HatsPolicy, "deploy");
    const deployMerkleGateekeper = deployment.getDeployConfigField(types_1.EContracts.MerkleProofPolicy, "deploy");
    const deployERC20VotesExcubiaePolicy = deployment.getDeployConfigField(types_1.EContracts.ERC20VotesPolicy, "deploy");
    const deployERC20ExcubiaePolicy = deployment.getDeployConfigField(types_1.EContracts.ERC20Policy, "deploy");
    const skipDeployFreeForAllPolicy = deployFreeForAllPolicy !== true;
    const skipDeployEASPolicy = deployEASPolicy !== true;
    const skipDeployGitcoinPolicy = deployGitcoinPolicy !== true;
    const skipDeployZupassPolicy = deployZupassPolicy !== true;
    const skipDeploySemaphorePolicy = deploySemaphorePolicy !== true;
    const skipDeployHatsPolicy = deployHatsSinglePolicy !== true;
    const skipDeployMerkleProofPolicy = deployMerkleGateekeper !== true;
    const skipDeployERC20VotesPolicy = deployERC20VotesExcubiaePolicy !== true;
    const skipDeployERC20Policy = deployERC20ExcubiaePolicy !== true;
    const canSkipDeploy = incremental &&
        (freeForAllPolicyContractAddress || skipDeployFreeForAllPolicy) &&
        (easPolicyContractAddress || skipDeployEASPolicy) &&
        (gitcoinPolicyContractAddress || skipDeployGitcoinPolicy) &&
        (zupassPolicyContractAddress || skipDeployZupassPolicy) &&
        (semaphorePolicyContractAddress || skipDeploySemaphorePolicy) &&
        (hatsPolicyContractAddress || skipDeployHatsPolicy) &&
        (merkleProofPolicyContractAddress || skipDeployMerkleProofPolicy) &&
        (erc20VotesPolicyContractAddress || skipDeployERC20VotesPolicy) &&
        (erc20PolicyContractAddress || skipDeployERC20Policy) &&
        (!skipDeployFreeForAllPolicy ||
            !skipDeployEASPolicy ||
            !skipDeployGitcoinPolicy ||
            !skipDeployZupassPolicy ||
            !skipDeploySemaphorePolicy ||
            !skipDeployHatsPolicy ||
            !skipDeployMerkleProofPolicy ||
            !skipDeployERC20VotesPolicy ||
            !skipDeployERC20Policy);
    if (canSkipDeploy) {
        // eslint-disable-next-line no-console
        (0, logger_1.logGreen)({ text: (0, logger_1.info)(`Skipping deployment of the Policy contract`) });
        return;
    }
    if (!skipDeployFreeForAllPolicy) {
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.FreeForAll,
            checker: types_1.ECheckerFactories.FreeForAll,
            network: hre.network.name,
            signer: deployer,
        });
        const [freeForAllPolicyContract, freeForAllCheckerContract, freeForAllPolicyFactoryContract, freeForAllCheckerFactoryContract,] = await deployFreeForAllSignUpPolicy(factories, deployer);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            freeForAllPolicyFactoryContract.IMPLEMENTATION(),
            freeForAllCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.FreeForAll,
                contract: freeForAllPolicyContract,
                name: types_1.EPolicies.FreeForAll,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.FreeForAll,
                contract: freeForAllCheckerContract,
                name: types_1.ECheckers.FreeForAll,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.FreeForAll,
                contract: freeForAllPolicyFactoryContract,
                name: types_1.EPolicyFactories.FreeForAll,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.FreeForAll,
                contract: freeForAllCheckerFactoryContract,
                name: types_1.ECheckerFactories.FreeForAll,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    const isSupportedEASPolicyNetwork = ![constants_1.ESupportedChains.Hardhat, constants_1.ESupportedChains.Coverage].includes(hre.network.name);
    if (!skipDeployEASPolicy && isSupportedEASPolicyNetwork) {
        const easAddress = deployment.getDeployConfigField(types_1.EContracts.EASPolicy, "easAddress", true);
        const encodedSchema = deployment.getDeployConfigField(types_1.EContracts.EASPolicy, "schema", true);
        const attester = deployment.getDeployConfigField(types_1.EContracts.EASPolicy, "attester", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.EAS,
            checker: types_1.ECheckerFactories.EAS,
            network: hre.network.name,
            signer: deployer,
        });
        const [easPolicyContract, easCheckerContract, easPolicyFactoryContract, easCheckerFactoryContract] = await deployEASSignUpPolicy({
            eas: easAddress,
            attester,
            schema: encodedSchema,
        }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            easPolicyFactoryContract.IMPLEMENTATION(),
            easCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.EAS,
                contract: easPolicyContract,
                name: types_1.EPolicies.EAS,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.EAS,
                contract: easCheckerContract,
                name: types_1.ECheckers.EAS,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.EAS,
                contract: easPolicyFactoryContract,
                name: types_1.EPolicyFactories.EAS,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.EAS,
                contract: easCheckerFactoryContract,
                name: types_1.ECheckerFactories.EAS,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    const isSupportedGitcoinPolicyNetwork = ![
        constants_1.ESupportedChains.Hardhat,
        constants_1.ESupportedChains.Coverage,
        constants_1.ESupportedChains.Sepolia,
        constants_1.ESupportedChains.Mainnet,
    ].includes(hre.network.name);
    if (!skipDeployGitcoinPolicy && isSupportedGitcoinPolicyNetwork) {
        const gitcoinPolicyDecoderAddress = deployment.getDeployConfigField(types_1.EContracts.GitcoinPassportPolicy, "decoderAddress", true);
        const gitcoinPolicyPassingScore = deployment.getDeployConfigField(types_1.EContracts.GitcoinPassportPolicy, "passingScore", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.GitcoinPassport,
            checker: types_1.ECheckerFactories.GitcoinPassport,
            network: hre.network.name,
            signer: deployer,
        });
        const [gitcoinPolicyContract, gitcoinCheckerContract, gitcoinPolicyFactoryContract, gitcoinCheckerFactoryContract,] = await deployGitcoinPassportPolicy({
            decoderAddress: gitcoinPolicyDecoderAddress,
            minimumScore: gitcoinPolicyPassingScore,
        }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            gitcoinPolicyFactoryContract.IMPLEMENTATION(),
            gitcoinCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.GitcoinPassport,
                contract: gitcoinPolicyContract,
                name: types_1.EPolicies.GitcoinPassport,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.GitcoinPassport,
                contract: gitcoinCheckerContract,
                name: types_1.ECheckers.GitcoinPassport,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.GitcoinPassport,
                contract: gitcoinPolicyFactoryContract,
                name: types_1.EPolicyFactories.GitcoinPassport,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.GitcoinPassport,
                contract: gitcoinCheckerFactoryContract,
                name: types_1.ECheckerFactories.GitcoinPassport,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeployZupassPolicy) {
        const eventId = deployment.getDeployConfigField(types_1.EContracts.ZupassPolicy, "eventId", true);
        const validEventId = (0, util_1.uuidToBigInt)(eventId);
        const signer1 = deployment.getDeployConfigField(types_1.EContracts.ZupassPolicy, "signer1", true);
        const validSigner1 = (0, util_1.hexToBigInt)(signer1);
        const signer2 = deployment.getDeployConfigField(types_1.EContracts.ZupassPolicy, "signer2", true);
        const validSigner2 = (0, util_1.hexToBigInt)(signer2);
        let verifier = deployment.getDeployConfigField(types_1.EContracts.ZupassPolicy, "zupassVerifier");
        if (!verifier) {
            const verifierContract = await deployment.deployContract({
                name: types_1.EContracts.ZupassGroth16Verifier,
                signer: deployer,
            });
            verifier = await verifierContract.getAddress();
        }
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.Zupass,
            checker: types_1.ECheckerFactories.Zupass,
            network: hre.network.name,
            signer: deployer,
        });
        const [zupassPolicyContract, zupassCheckerContract, zupassPolicyFactoryContract, zupassCheckerFactoryContract] = await deployZupassSignUpPolicy({ eventId: validEventId, signer1: validSigner1, signer2: validSigner2, verifier }, factories, deployer);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            zupassPolicyFactoryContract.IMPLEMENTATION(),
            zupassCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.Zupass,
                contract: zupassPolicyContract,
                name: types_1.EPolicies.Zupass,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.Zupass,
                contract: zupassCheckerContract,
                name: types_1.ECheckers.Zupass,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.Zupass,
                contract: zupassCheckerFactoryContract,
                name: types_1.ECheckerFactories.Zupass,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.Zupass,
                contract: zupassPolicyFactoryContract,
                name: types_1.EPolicyFactories.Zupass,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeploySemaphorePolicy) {
        const semaphoreContractAddress = deployment.getDeployConfigField(types_1.EContracts.SemaphorePolicy, "semaphoreContract", true);
        const groupId = deployment.getDeployConfigField(types_1.EContracts.SemaphorePolicy, "groupId", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.Semaphore,
            checker: types_1.ECheckerFactories.Semaphore,
            network: hre.network.name,
            signer: deployer,
        });
        const [semaphorePolicyContract, semaphoreCheckerContract, semaphorePolicyFactoryContract, semaphoreCheckerFactoryContract,] = await deploySemaphoreSignupPolicy({ semaphore: semaphoreContractAddress, groupId }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            semaphorePolicyFactoryContract.IMPLEMENTATION(),
            semaphoreCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.Semaphore,
                contract: semaphorePolicyContract,
                name: types_1.EPolicies.Semaphore,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.Semaphore,
                contract: semaphoreCheckerContract,
                name: types_1.ECheckers.Semaphore,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.Semaphore,
                contract: semaphorePolicyFactoryContract,
                name: types_1.EPolicyFactories.Semaphore,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.Semaphore,
                contract: semaphoreCheckerFactoryContract,
                name: types_1.ECheckerFactories.Semaphore,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeployHatsPolicy) {
        // get args
        const criterionHats = deployment.getDeployConfigField(types_1.EContracts.HatsPolicy, "criterionHats", true);
        const hatsProtocolAddress = deployment.getDeployConfigField(types_1.EContracts.HatsPolicy, "hatsProtocolAddress", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.Hats,
            checker: types_1.ECheckerFactories.Hats,
            network: hre.network.name,
            signer: deployer,
        });
        const [hatsPolicyContract, hatsCheckerContract, hatsPolicyFactoryContract, hatsCheckerFactoryContract] = await deployHatsSignupPolicy({ hats: hatsProtocolAddress, criterionHats }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            hatsPolicyFactoryContract.IMPLEMENTATION(),
            hatsCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.Hats,
                contract: hatsPolicyContract,
                name: types_1.EPolicies.Hats,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.Hats,
                contract: hatsCheckerContract,
                name: types_1.ECheckers.Hats,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.Hats,
                contract: hatsPolicyFactoryContract,
                name: types_1.EPolicyFactories.Hats,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.Hats,
                contract: hatsCheckerFactoryContract,
                name: types_1.ECheckerFactories.Hats,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeployMerkleProofPolicy) {
        const root = deployment.getDeployConfigField(types_1.EContracts.MerkleProofPolicy, "root", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.MerkleProof,
            checker: types_1.ECheckerFactories.MerkleProof,
            network: hre.network.name,
            signer: deployer,
        });
        const [merkleProofPolicyContract, merkleProofCheckerContract, merkleProofPolicyFactoryContract, merkleProofCheckerFactoryContract,] = await deployMerkleProofPolicy({ root }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            merkleProofPolicyFactoryContract.IMPLEMENTATION(),
            merkleProofCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.MerkleProof,
                contract: merkleProofPolicyContract,
                name: types_1.EPolicies.MerkleProof,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.MerkleProof,
                contract: merkleProofCheckerContract,
                name: types_1.ECheckers.MerkleProof,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.MerkleProof,
                contract: merkleProofPolicyFactoryContract,
                name: types_1.EPolicyFactories.MerkleProof,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.MerkleProof,
                contract: merkleProofCheckerFactoryContract,
                name: types_1.ECheckerFactories.MerkleProof,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeployERC20VotesPolicy) {
        const token = deployment.getDeployConfigField(types_1.EContracts.ERC20VotesPolicy, "token", true);
        const threshold = deployment.getDeployConfigField(types_1.EContracts.ERC20VotesPolicy, "threshold", true);
        const snapshotBlock = deployment.getDeployConfigField(types_1.EContracts.ERC20VotesPolicy, "snapshotBlock", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.ERC20Votes,
            checker: types_1.ECheckerFactories.ERC20Votes,
            network: hre.network.name,
            signer: deployer,
        });
        const [erc20VotesPolicyContract, erc20VotesCheckerContract, erc20VotesPolicyFactoryContract, erc20VotesCheckerFactoryContract,] = await deployERC20VotesPolicy({
            token,
            threshold: BigInt(threshold),
            snapshotBlock: BigInt(snapshotBlock),
        }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            erc20VotesPolicyFactoryContract.IMPLEMENTATION(),
            erc20VotesCheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.ERC20Votes,
                contract: erc20VotesPolicyContract,
                name: types_1.EPolicies.ERC20Votes,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.ERC20Votes,
                contract: erc20VotesCheckerContract,
                name: types_1.ECheckers.ERC20Votes,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.ERC20Votes,
                contract: erc20VotesPolicyFactoryContract,
                name: types_1.EPolicyFactories.ERC20Votes,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.ERC20Votes,
                contract: erc20VotesCheckerFactoryContract,
                name: types_1.ECheckerFactories.ERC20Votes,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
    if (!skipDeployERC20Policy) {
        const token = deployment.getDeployConfigField(types_1.EContracts.ERC20Policy, "token", true);
        const threshold = deployment.getDeployConfigField(types_1.EContracts.ERC20Policy, "threshold", true);
        const factories = await getDeployedPolicyProxyFactories({
            policy: types_1.EPolicyFactories.ERC20Votes,
            checker: types_1.ECheckerFactories.ERC20Votes,
            network: hre.network.name,
            signer: deployer,
        });
        const [erc20PolicyContract, erc20CheckerContract, erc20PolicyFactoryContract, erc20CheckerFactoryContract] = await deployERC20Policy({
            token,
            threshold: BigInt(threshold),
        }, factories, deployer, true);
        const [policyContractImplementation, checkerContractImplementation] = await Promise.all([
            erc20PolicyFactoryContract.IMPLEMENTATION(),
            erc20CheckerFactoryContract.IMPLEMENTATION(),
        ]);
        await Promise.all([
            storage.register({
                id: types_1.EPolicies.ERC20,
                contract: erc20PolicyContract,
                name: types_1.EPolicies.ERC20,
                implementation: policyContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckers.ERC20,
                contract: erc20CheckerContract,
                name: types_1.ECheckers.ERC20,
                implementation: checkerContractImplementation,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.EPolicyFactories.ERC20,
                contract: erc20PolicyFactoryContract,
                name: types_1.EPolicyFactories.ERC20,
                args: [],
                network: hre.network.name,
            }),
            storage.register({
                id: types_1.ECheckerFactories.ERC20,
                contract: erc20CheckerFactoryContract,
                name: types_1.ECheckerFactories.ERC20,
                args: [],
                network: hre.network.name,
            }),
        ]);
    }
}));
//# sourceMappingURL=01-policies.js.map