Skip to content

Commit

Permalink
Merge pull request #214 from VenusProtocol/feat/VEN-2712
Browse files Browse the repository at this point in the history
[VEN-2712] OneJumpOracle deployment script and files for wstETH and weETH on arbitrum sepolia
  • Loading branch information
Debugger022 authored Aug 27, 2024
2 parents bd09e77 + 520b24a commit 6abadd7
Show file tree
Hide file tree
Showing 11 changed files with 2,796 additions and 1 deletion.
62 changes: 62 additions & 0 deletions deploy/13-deploy-wstETH-weETH-oracles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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,
artifacts,
}: HardhatRuntimeEnvironment) {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
const proxyOwnerAddress = ADDRESSES[network.name].timelock;
const { WETH, wstETH, weETH } = ADDRESSES[network.name];

const resilientOracle = await hre.ethers.getContract("ResilientOracle");
const chainlinkOracle = await hre.ethers.getContract("ChainlinkOracle");

const defaultProxyAdmin = await artifacts.readArtifact(
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

await deploy("wstETHOneJumpChainlinkOracle", {
contract: "OneJumpOracle",
from: deployer,
log: true,
deterministicDeployment: false,
args: [wstETH, WETH, resilientOracle.address, chainlinkOracle.address],
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentUpgradeableProxy",
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
},
skipIfAlreadyDeployed: true,
});

await deploy("weETHOneJumpChainlinkOracle", {
contract: "OneJumpOracle",
from: deployer,
log: true,
deterministicDeployment: false,
args: [weETH, WETH, resilientOracle.address, chainlinkOracle.address],
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentUpgradeableProxy",
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
},
skipIfAlreadyDeployed: true,
});
};

func.skip = async () => hre.network.name !== "arbitrumone" && hre.network.name !== "arbitrumsepolia";
func.tags = ["wstETH_weETH_OneJumpOracles_arbitrum"];
export default func;
Loading

0 comments on commit 6abadd7

Please sign in to comment.