"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, artifacts, }) => {
    const { deploy } = deployments;
    const { deployer } = await getNamedAccounts();
    const resilientOracle = await hardhat_1.ethers.getContract("ResilientOracle");
    const proxyOwnerAddress = network.live ? deploymentConfig_1.ADDRESSES[network.name].timelock : deployer;
    const defaultProxyAdmin = await artifacts.readArtifact("hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin");
    let { eBTC_Accountant } = deploymentConfig_1.ADDRESSES[network.name];
    const { WBTC, eBTC } = deploymentConfig_1.ADDRESSES[network.name];
    eBTC_Accountant = eBTC_Accountant || (await hardhat_1.ethers.getContract("MockAccountant_eBTC")).address;
    await deploy("eBTCAccountantOracle", {
        contract: "EtherfiAccountantOracle",
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [eBTC_Accountant, eBTC, WBTC, resilientOracle.address],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentUpgradeableProxy",
            viaAdminContract: {
                name: "DefaultProxyAdmin",
                artifact: defaultProxyAdmin,
            },
        },
        skipIfAlreadyDeployed: true,
    });
};
exports.default = func;
func.tags = ["eBTCAccountantOracle"];
func.skip = async (hre) => hre.network.name !== "ethereum" && hre.network.name !== "sepolia";
//# sourceMappingURL=14-deploy-eBTC-oracle.js.map