"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 { weETHs_Accountant } = deploymentConfig_1.ADDRESSES[network.name];
    const { weETHs, WETH } = deploymentConfig_1.ADDRESSES[network.name];
    weETHs_Accountant = weETHs_Accountant || (await hardhat_1.ethers.getContract("MockAccountant_weETHs")).address;
    await deploy("WeETHAccountantOracle_weETHs", {
        contract: "WeETHAccountantOracle",
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [weETHs_Accountant, weETHs, WETH, resilientOracle.address],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentUpgradeableProxy",
            viaAdminContract: {
                name: "DefaultProxyAdmin",
                artifact: defaultProxyAdmin,
            },
        },
        skipIfAlreadyDeployed: true,
    });
};
exports.default = func;
func.tags = ["WeETHAccountantOracle_weETHs"];
func.skip = async (hre) => hre.network.name !== "ethereum" && hre.network.name !== "sepolia";
//# sourceMappingURL=13-deploy-weETHs-oracle.js.map