"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 = void 0;
const hardhat_1 = require("hardhat");
exports.delayConfig = {
    hardhat: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
    bscmainnet: {
        normal: 172800,
        fast: 21600,
        critical: 3600,
    },
    bsctestnet: {
        normal: 600,
        fast: 300,
        critical: 100,
    },
};
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 || "bsctestnet" || "bscmainnet";
        const live = hre.network.live;
        const getAdmin = () => __awaiter(this, void 0, void 0, function* () {
            return live ? (yield hardhat_1.ethers.getContract("GovernorBravoDelegator")).address : deployer;
        });
        yield deploy("NormalTimelock", {
            contract: live ? "Timelock" : "TestTimelockV8",
            from: deployer,
            args: [yield getAdmin(), exports.delayConfig[networkName].normal],
            log: true,
            autoMine: true,
        });
        yield deploy("FastTrackTimelock", {
            contract: live ? "Timelock" : "TestTimelockV8",
            from: deployer,
            args: [yield getAdmin(), exports.delayConfig[networkName].fast],
            log: true,
            autoMine: true,
        });
        yield deploy("CriticalTimelock", {
            contract: live ? "Timelock" : "TestTimelockV8",
            from: deployer,
            args: [yield getAdmin(), exports.delayConfig[networkName].critical],
            log: true,
            autoMine: true,
        });
    });
};
func.tags = ["LocalTimelock"];
func.skip = (hre) => __awaiter(void 0, void 0, void 0, function* () { return !(hre.network.name === "bsctestnet" || hre.network.name === "bscmainnet") && hre.network.name !== "hardhat"; });
exports.default = func;
//# sourceMappingURL=001-source-timelocks.js.map