generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from VenusProtocol/feat/ven-2639
[VEN-2639]: Oracle for rsETH on Ethereum & sepolia
- Loading branch information
Showing
19 changed files
with
5,314 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
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(); | ||
const proxyOwnerAddress = network.live ? ADDRESSES[network.name].timelock : deployer; | ||
let WETH; | ||
let rsETH; | ||
if (network.name === "sepolia" || network.name === "ethereum") { | ||
({ WETH } = ADDRESSES[network.name]); | ||
rsETH = | ||
network.name === "sepolia" | ||
? "0xfA0614E5C803E15070d31f7C38d2d430EBe68E47" | ||
: "0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7"; | ||
} | ||
|
||
console.log(`Timelock (${proxyOwnerAddress})`); | ||
const redStoneOracle = await hre.ethers.getContract("RedStoneOracle"); | ||
const resilientOracle = await hre.ethers.getContract("ResilientOracle"); | ||
const chainlinkOracle = await hre.ethers.getContract("ChainlinkOracle"); | ||
|
||
await deploy("rsETHOneJumpRedStoneOracle", { | ||
contract: "OneJumpOracle", | ||
from: deployer, | ||
log: true, | ||
deterministicDeployment: false, | ||
args: [rsETH, WETH, resilientOracle.address, redStoneOracle.address], | ||
proxy: { | ||
owner: proxyOwnerAddress, | ||
proxyContract: "OptimizedTransparentProxy", | ||
}, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
await deploy("rsETHOneJumpChainlinkOracle", { | ||
contract: "OneJumpOracle", | ||
from: deployer, | ||
log: true, | ||
deterministicDeployment: false, | ||
args: [rsETH, WETH, resilientOracle.address, chainlinkOracle.address], | ||
proxy: { | ||
owner: proxyOwnerAddress, | ||
proxyContract: "OptimizedTransparentProxy", | ||
}, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
}; | ||
|
||
func.skip = async () => hre.network.name !== "ethereum" && hre.network.name !== "sepolia"; | ||
|
||
func.tags = ["rsETHOneJumpOracles"]; | ||
export default func; |
Oops, something went wrong.