Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions deploy/23-deploy-weETH-wstETH-one-jump-oracles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import hre from "hardhat";
import { DeployFunction } from "hardhat-deploy/dist/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ADDRESSES } from "../helpers/deploymentConfig";

const func: DeployFunction = async function ({ getNamedAccounts, deployments, network }: HardhatRuntimeEnvironment) {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
if (!deployer) {
throw new Error("Deployer address is not defined. Ensure deployer is set in namedAccounts.");
}

const { WETH, weETH, wstETH, acm } = ADDRESSES[network.name];
const resilientOracle = await hre.ethers.getContract("ResilientOracle");
const redstoneOracle = await hre.ethers.getContract("RedStoneOracle");

const commonParams = {
from: deployer,
log: true,
deterministicDeployment: false,
waitConfirmations: 1,
};

// Deploy weETH OneJumpOracle
await deploy("weETHOneJumpOracle", {
contract: "OneJumpOracle",
args: [weETH, WETH, resilientOracle.address, redstoneOracle.address, 0, 0, 0, 0, acm, 0],
...commonParams,
});

// Deploy wstETH OneJumpOracle
await deploy("wstETHOneJumpOracle", {
contract: "OneJumpOracle",
args: [wstETH, WETH, resilientOracle.address, redstoneOracle.address, 0, 0, 0, 0, acm, 0],
...commonParams,
});
};

func.skip = async () => !["unichainsepolia", "unichainmainnet"].includes(hre.network.name);

func.tags = ["weETH_OneJumpOracle", "wstETH_OneJumpOracle"];
export default func;
Loading