"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hardhat_1 = require("hardhat");
const deploymentConfig_1 = require("../helpers/deploymentConfig");
var PendleRateKind;
(function (PendleRateKind) {
    PendleRateKind[PendleRateKind["PT_TO_ASSET"] = 0] = "PT_TO_ASSET";
    PendleRateKind[PendleRateKind["PT_TO_SY"] = 1] = "PT_TO_SY";
})(PendleRateKind || (PendleRateKind = {}));
const func = async ({ getNamedAccounts, deployments, network }) => {
    const { deploy } = deployments;
    const { deployer } = await getNamedAccounts();
    const oracle = await hardhat_1.ethers.getContract("ResilientOracle");
    const proxyOwnerAddress = network.live ? deploymentConfig_1.ADDRESSES[network.name].timelock : deployer;
    const redStoneOracle = await hardhat_1.ethers.getContract("RedStoneOracle");
    const resilientOracle = await hardhat_1.ethers.getContract("ResilientOracle");
    const addresses = deploymentConfig_1.ADDRESSES[network.name];
    const ptOracleAddress = addresses.PTOracle || (await hardhat_1.ethers.getContract("MockPendlePtOracle")).address;
    await deploy("SolvBTC.BBN_OneJumpRedStoneOracle", {
        contract: "OneJumpOracle",
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [addresses["SolvBTC.BBN"], addresses.BTCB, resilientOracle.address, redStoneOracle.address],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentProxy",
        },
        skipIfAlreadyDeployed: true,
    });
    await deploy("PendleOracle-PT-SolvBTC.BBN-27MAR2025", {
        contract: "PendleOracle",
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [
            addresses["PT-SolvBTC.BBN-27MAR2025_Market"] || "0x0000000000000000000000000000000000000001",
            ptOracleAddress,
            PendleRateKind.PT_TO_SY,
            addresses["PT-SolvBTC.BBN-27MAR2025"],
            addresses["SolvBTC.BBN"],
            oracle.address,
            900,
        ],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentUpgradeableProxy",
        },
        skipIfAlreadyDeployed: true,
    });
};
exports.default = func;
func.tags = ["PT-SolvBTC.BBN"];
func.skip = async (hre) => hre.network.name !== "bsctestnet" && hre.network.name !== "bscmainnet";
//# sourceMappingURL=16-deploy-SolvBTC.BBN-pendle-oracles.js.map