"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hardhat_1 = require("hardhat");
const deploymentConfig_1 = require("../helpers/deploymentConfig");
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 { sFRAX, FRAX } = deploymentConfig_1.ADDRESSES[network.name];
    await deploy("SFraxOracle", {
        contract: "SFraxOracle",
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [sFRAX || (await hardhat_1.ethers.getContract("MockSFrax")).address, FRAX, oracle.address],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentProxy",
        },
        skipIfAlreadyDeployed: true,
    });
};
exports.default = func;
func.tags = ["sFraxOracle"];
func.skip = async (hre) => hre.network.name !== "ethereum" && hre.network.name !== "sepolia";
//# sourceMappingURL=9-deploy-sfrax-oracle.js.map