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
10 changes: 10 additions & 0 deletions deploy/23-deploy-xSolvBTC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const func: DeployFunction = async function ({ getNamedAccounts, deployments, ne

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

await deploy("xSolvBTCOneJumpRedStoneOracle", {
contract: "OneJumpOracle",
Expand All @@ -20,6 +21,15 @@ const func: DeployFunction = async function ({ getNamedAccounts, deployments, ne
args: [xSolvBTC, SolvBTC, resilientOracle.address, redstoneOracle.address, 0, 0, 0, 0, acm, 0],
skipIfAlreadyDeployed: true,
});

await deploy("xSolvBTCOneJumpChainlinkOracle", {
contract: "OneJumpOracle",
from: deployer,
log: true,
deterministicDeployment: false,
args: [xSolvBTC, SolvBTC, resilientOracle.address, chainlinkOracle.address, 0, 0, 0, 0, acm, 0],
skipIfAlreadyDeployed: true,
});
};

func.skip = async () => hre.network.name !== "bscmainnet" && hre.network.name !== "bsctestnet";
Expand Down
49 changes: 49 additions & 0 deletions deploy/30-deploy-apro-oracle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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;
const defaultProxyAdmin = await hre.artifacts.readArtifact(
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

const contractName = "ChainlinkOracle";

await deploy("APROOracle", {
contract: network.live ? contractName : "MockChainlinkOracle",
from: deployer,
log: true,
deterministicDeployment: false,
skipIfAlreadyDeployed: true,
args: [],
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: network.live ? [ADDRESSES[network.name].acm] : [],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
},
});

const aproOracle = await hre.ethers.getContract("APROOracle");
const aproOracleOwner = await aproOracle.owner();

if (aproOracleOwner === deployer && network.live) {
await aproOracle.transferOwnership(proxyOwnerAddress);
console.log(`Ownership of APROOracle transferred from deployer to Timelock (${proxyOwnerAddress})`);
}
};

func.tags = ["deploy-apro"];
func.skip = async env => !env.network.live;
export default func;
Loading
Loading