"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const hardhat_1 = __importDefault(require("hardhat"));
const deploymentConfig_1 = require("../helpers/deploymentConfig");
const func = async function ({ getNamedAccounts, deployments, network }) {
    const { deploy, catchUnknownSigner } = deployments;
    const { deployer } = await getNamedAccounts();
    const { vBNBAddress } = deploymentConfig_1.ADDRESSES[network.name];
    const { VAIAddress } = deploymentConfig_1.ADDRESSES[network.name];
    const proxyOwnerAddress = network.live ? deploymentConfig_1.ADDRESSES[network.name].timelock : deployer;
    const boundValidator = await hardhat_1.default.ethers.getContract("BoundValidator");
    const defaultProxyAdmin = await hardhat_1.default.artifacts.readArtifact("hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin");
    await catchUnknownSigner(deploy("ResilientOracle", {
        from: deployer,
        log: true,
        deterministicDeployment: false,
        args: [vBNBAddress, VAIAddress, boundValidator.address],
        proxy: {
            owner: proxyOwnerAddress,
            proxyContract: "OptimizedTransparentUpgradeableProxy",
            viaAdminContract: {
                name: "DefaultProxyAdmin",
                artifact: defaultProxyAdmin,
            },
        },
    }));
};
exports.default = func;
func.tags = ["update-resilientOracle"];
func.skip = async (env) => !env.network.live;
//# sourceMappingURL=3-resilient-oracle-imp-update.js.map