"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// MAINNET DEPLOYED CONTRACTS
const bscmainnet_json_1 = __importDefault(require("../deployments/bscmainnet.json"));
// TESTNET DEPLOYED CONTRACTS
const bsctestnet_json_1 = __importDefault(require("../deployments/bsctestnet.json"));
const deploymentConfig_1 = require("../helpers/deploymentConfig");
const func = async function (hre) {
    const { deployments, getNamedAccounts } = hre;
    const { deploy } = deployments;
    const { deployer } = await getNamedAccounts();
    const unitrollerAddresses = (await deployments.get("Unitroller")).address;
    const wBNBAddress = (await deployments.get("WBNB")).address;
    const vbnbAddress = (await deployments.get("vBNB")).address;
    // Pancake Factory doesn't exist on hardhat so we are using the testnet address
    const pancakeFactoryAddress = hre.network.name === "bscmainnet"
        ? bscmainnet_json_1.default.contracts.pancakeFactory.address
        : bsctestnet_json_1.default.contracts.pancakeFactory.address;
    await deploy("SwapRouterCorePool", {
        contract: "SwapRouter",
        from: deployer,
        args: [wBNBAddress, pancakeFactoryAddress, unitrollerAddresses, vbnbAddress],
        log: true,
        autoMine: true,
    });
};
func.tags = ["SwapRouter"];
// Pancake Factory is not deployed on the local network
func.skip = (0, deploymentConfig_1.skipRemoteNetworks)();
exports.default = func;
