"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.delayConfig = exports.REMOTE_NETWORKS = void 0;
const hardhat_1 = require("hardhat");
var REMOTE_NETWORKS;
(function (REMOTE_NETWORKS) {
    REMOTE_NETWORKS["ETHERUEM"] = "ethereum";
    REMOTE_NETWORKS["OPBNBMAINNET"] = "opbnbmainnet";
    REMOTE_NETWORKS["ARBITRUM_ONE"] = "arbitrumone";
    REMOTE_NETWORKS["SEPOLIA"] = "sepolia";
    REMOTE_NETWORKS["OPBNBTESTNET"] = "opbnbtestnet";
    REMOTE_NETWORKS["ARBITRUM_SEPOLIA"] = "arbitrumsepolia";
    REMOTE_NETWORKS["ZKSYNCSEPOLIA"] = "zksyncsepolia";
    REMOTE_NETWORKS["ZKSYNCMAINNET"] = "zksyncmainnet";
    REMOTE_NETWORKS["OPSEPOLIA"] = "opsepolia";
    REMOTE_NETWORKS["OPMAINNET"] = "opmainnet";
    REMOTE_NETWORKS["BASESEPOLIA"] = "basesepolia";
    REMOTE_NETWORKS["BASEMAINNET"] = "basemainnet";
    REMOTE_NETWORKS["UNICHAINSEPOLIA"] = "unichainsepolia";
    REMOTE_NETWORKS["UNICHAINMAINNET"] = "unichainmainnet";
    REMOTE_NETWORKS["HARDHAT"] = "hardhat";
})(REMOTE_NETWORKS = exports.REMOTE_NETWORKS || (exports.REMOTE_NETWORKS = {}));
exports.delayConfig = {
    hardhat: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    sepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    ethereum: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    opbnbtestnet: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    opbnbmainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    arbitrumsepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    arbitrumone: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    zksyncsepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    zksyncmainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    opsepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    opmainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    basesepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    basemainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    unichainsepolia: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    unichainmainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
};
const func = function (hre) {
    return __awaiter(this, void 0, void 0, function* () {
        const { deployments, getNamedAccounts } = hre;
        const { deploy } = deployments;
        const { deployer } = yield getNamedAccounts();
        const networkName = hre.network.name;
        const live = hre.network.live;
        const omnichainGovernanceExecutorAddress = (yield hardhat_1.ethers.getContract("OmnichainGovernanceExecutor")).address;
        yield deploy(live ? "NormalTimelock" : "NormalTimelockRemote", {
            contract: live ? "TimelockV8" : "TestTimelockV8",
            from: deployer,
            args: [omnichainGovernanceExecutorAddress, exports.delayConfig[networkName].normal],
            log: true,
            autoMine: true,
            skipIfAlreadyDeployed: true,
        });
        yield deploy(live ? "FastTrackTimelock" : "FastTrackTimelockRemote", {
            contract: live ? "TimelockV8" : "TestTimelockV8",
            from: deployer,
            args: [omnichainGovernanceExecutorAddress, exports.delayConfig[networkName].fast],
            log: true,
            autoMine: true,
            skipIfAlreadyDeployed: true,
        });
        yield deploy(live ? "CriticalTimelock" : "CriticalTimelockRemote", {
            contract: live ? "TimelockV8" : "TestTimelockV8",
            from: deployer,
            args: [omnichainGovernanceExecutorAddress, exports.delayConfig[networkName].critical],
            log: true,
            autoMine: true,
            skipIfAlreadyDeployed: true,
        });
    });
};
func.tags = ["RemoteTimelock", "Remote"];
func.skip = (hre) => __awaiter(void 0, void 0, void 0, function* () { return hre.network.name === "bsctestnet" || hre.network.name === "bscmainnet"; });
exports.default = func;
//# sourceMappingURL=005-remote-timelock.js.map