Skip to content

Commit

Permalink
feat: HIGH collateral potential deployment (#215)
Browse files Browse the repository at this point in the history
* first batch of test done

* update final hash of vaultManager implementation

* [WIP] feat: deployment for HIGH

* fix: HIGH oracle value

* fix: deployment for HIGH

* fix: layerzero test

* feat: bhigh deployment

---------

Co-authored-by: gs8nrv <[email protected]>
  • Loading branch information
sogipec and GuillaumeNervoXS authored Jun 13, 2023
1 parent bd13bf5 commit 2fb38de
Show file tree
Hide file tree
Showing 15 changed files with 1,122 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.12;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

import "../../../BaseOracleChainlinkMultiTwoFeeds.sol";

/// @title OracleHIGHEURChainlink
/// @author Angle Labs, Inc.
/// @notice Gives the price of HIGH in Euro in base 18
contract OracleHIGHEURChainlink is BaseOracleChainlinkMultiTwoFeeds {
string public constant DESCRIPTION = "HIGH/EUR Oracle";

constructor(uint32 _stalePeriod, address _treasury) BaseOracleChainlinkMultiTwoFeeds(_stalePeriod, _treasury) {}

/// @inheritdoc IOracle
function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) {
AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](1);
// Oracle HIGH/EUR
_circuitChainlink[0] = AggregatorV3Interface(0x9E8E794ad6Ecdb6d5c7eaBE059D30E907F58859b);
return _circuitChainlink;
}

/// @inheritdoc BaseOracleChainlinkMultiTwoFeeds
function read() external view override returns (uint256 quoteAmount) {
quoteAmount = _readChainlinkFeed(_getQuoteAmount(), circuitChainlink()[0], 1, 8);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract OracleIB01EURChainlink is BaseOracleChainlinkMultiTwoFeeds {
function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) {
AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](2);
// Oracle IB01/USD
_circuitChainlink[0] = AggregatorV3Interface(0x788D911ae7c95121A89A0f0306db65D87422E1de);
_circuitChainlink[0] = AggregatorV3Interface(0x32d1463EB53b73C095625719Afa544D5426354cB);
// Oracle EUR/USD
_circuitChainlink[1] = AggregatorV3Interface(0xb49f677943BC038e9857d61E7d053CaA2C1734C1);
return _circuitChainlink;
Expand Down
28 changes: 14 additions & 14 deletions deploy/4_oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const argv = yargs.env('').boolean('ci').parseSync();
const func: DeployFunction = async ({ deployments, ethers, network }) => {
const { deploy } = deployments;
const { deployer } = await ethers.getNamedSigners();
const stableName = 'EUR';
// const treasury = (await deployments.get(`Treasury_${stableName}`)).address;
let treasury: string;
let chainName: string;
if (!network.live || network.config.chainId == 1) {
Expand All @@ -21,27 +19,29 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
treasury = registry(network.config.chainId as ChainId)?.agEUR?.Treasury!;
}

console.log('Now deploying the Oracle IB01/EUR');
await deploy('Oracle_IB01_EUR', {
contract: `OracleIB01EURChainlink`,
console.log('Now deploying the Oracle HIGH/EUR');
await deploy('Oracle_HIGH_EUR', {
contract: `OracleHIGHEURChainlink`,
from: deployer.address,
args: [3600 * 30, treasury],
// Higher stalePeriod for HIGH
args: [3600 * 24 * 3, treasury],
log: !argv.ci,
});
const oracle = (await deployments.get('Oracle_IB01_EUR')).address;
console.log(`Successfully deployed Oracle IB01/EUR at the address ${oracle}`);
const oracle = (await deployments.get('Oracle_HIGH_EUR')).address;
console.log(`Successfully deployed Oracle HIGH/EUR at the address ${oracle}`);
console.log('');

await deploy('Oracle_USDC_EUR', {
contract: `OracleUSDCEURChainlink`,
console.log('Now deploying the Oracle IB01/EUR');
await deploy('Oracle_IB01_EUR', {
contract: `OracleIB01EURChainlink`,
from: deployer.address,
args: [3600 * 30, treasury],
// Higher stalePeriod for IB01
args: [3600 * 24 * 3, treasury],
log: !argv.ci,
});
const oracle2 = (await deployments.get('Oracle_USDC_EUR')).address;
console.log(`Successfully deployed Oracle USDC/EUR at the address ${oracle2}`);
const oracle2 = (await deployments.get('Oracle_IB01_EUR')).address;
console.log(`Successfully deployed Oracle IB01/EUR at the address ${oracle2}`);
console.log('');

const oracleContract = new ethers.Contract(
oracle,
OracleIB01EURChainlink__factory.createInterface(),
Expand Down
7 changes: 5 additions & 2 deletions deploy/6_vaultManagerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
/**
* TODO: change implementation depending on what is being deployed
*/
const implementationName = 'VaultManager_PermissionedLiquidations_Implementation';
// const implementation = (await ethers.getContract(implementationName)).address;
const implementation = '0x88fE06D438F5264dA8e2CDCAc3DAED1eA70F995a';

const { deploy } = deployments;
const { deployer } = await ethers.getNamedSigners();

Expand Down Expand Up @@ -64,7 +68,6 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {

const treasury = new Contract(treasuryAddress, Treasury__factory.abi, deployer);

const implementation = (await ethers.getContract('VaultManager_PermissionedLiquidations_Implementation')).address;
const callData = new ethers.Contract(
implementation,
VaultManager__factory.createInterface(),
Expand Down Expand Up @@ -93,5 +96,5 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
};

func.tags = ['vaultManagerProxy'];
// func.dependencies = ['vaultManagerImplementation'];
func.dependencies = ['oracle'];
export default func;
2 changes: 1 addition & 1 deletion deploy/networks/hardhat.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"oneInchRouter": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
"angleRouter": "0xBB755240596530be0c1DE5DFD77ec6398471561d",
"dust": "0",
"vaultsList": ["USDC"]
"vaultsList": ["bHIGH"]
}
2 changes: 1 addition & 1 deletion deploy/networks/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"oneInchRouter": "0x1111111254EEB25477B68fb85Ed929f73A960582",
"angleRouter": "0xBB755240596530be0c1DE5DFD77ec6398471561d",
"dust": "0",
"vaultsList": ["bIB01"]
"vaultsList": ["bHIGH"]
}
247 changes: 247 additions & 0 deletions deployments/mainnet/Oracle_HIGH_EUR.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions deployments/mainnet/Oracle_IB01_EUR.json

Large diffs are not rendered by default.

247 changes: 247 additions & 0 deletions deployments/mainnet/VaultManager_bHIGH_EUR.json

Large diffs are not rendered by default.

Loading

0 comments on commit 2fb38de

Please sign in to comment.