Skip to content

Commit 2fb38de

Browse files
feat: HIGH collateral potential deployment (#215)
* 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]>
1 parent bd13bf5 commit 2fb38de

File tree

15 files changed

+1122
-47
lines changed

15 files changed

+1122
-47
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-License-Identifier: GPL-3.0
2+
3+
pragma solidity ^0.8.12;
4+
5+
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
6+
7+
import "../../../BaseOracleChainlinkMultiTwoFeeds.sol";
8+
9+
/// @title OracleHIGHEURChainlink
10+
/// @author Angle Labs, Inc.
11+
/// @notice Gives the price of HIGH in Euro in base 18
12+
contract OracleHIGHEURChainlink is BaseOracleChainlinkMultiTwoFeeds {
13+
string public constant DESCRIPTION = "HIGH/EUR Oracle";
14+
15+
constructor(uint32 _stalePeriod, address _treasury) BaseOracleChainlinkMultiTwoFeeds(_stalePeriod, _treasury) {}
16+
17+
/// @inheritdoc IOracle
18+
function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) {
19+
AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](1);
20+
// Oracle HIGH/EUR
21+
_circuitChainlink[0] = AggregatorV3Interface(0x9E8E794ad6Ecdb6d5c7eaBE059D30E907F58859b);
22+
return _circuitChainlink;
23+
}
24+
25+
/// @inheritdoc BaseOracleChainlinkMultiTwoFeeds
26+
function read() external view override returns (uint256 quoteAmount) {
27+
quoteAmount = _readChainlinkFeed(_getQuoteAmount(), circuitChainlink()[0], 1, 8);
28+
}
29+
}

contracts/oracle/implementations/mainnet/EUR/OracleIB01EURChainlink.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ contract OracleIB01EURChainlink is BaseOracleChainlinkMultiTwoFeeds {
1818
function circuitChainlink() public pure override returns (AggregatorV3Interface[] memory) {
1919
AggregatorV3Interface[] memory _circuitChainlink = new AggregatorV3Interface[](2);
2020
// Oracle IB01/USD
21-
_circuitChainlink[0] = AggregatorV3Interface(0x788D911ae7c95121A89A0f0306db65D87422E1de);
21+
_circuitChainlink[0] = AggregatorV3Interface(0x32d1463EB53b73C095625719Afa544D5426354cB);
2222
// Oracle EUR/USD
2323
_circuitChainlink[1] = AggregatorV3Interface(0xb49f677943BC038e9857d61E7d053CaA2C1734C1);
2424
return _circuitChainlink;

deploy/4_oracle.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const argv = yargs.env('').boolean('ci').parseSync();
99
const func: DeployFunction = async ({ deployments, ethers, network }) => {
1010
const { deploy } = deployments;
1111
const { deployer } = await ethers.getNamedSigners();
12-
const stableName = 'EUR';
13-
// const treasury = (await deployments.get(`Treasury_${stableName}`)).address;
1412
let treasury: string;
1513
let chainName: string;
1614
if (!network.live || network.config.chainId == 1) {
@@ -21,27 +19,29 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
2119
treasury = registry(network.config.chainId as ChainId)?.agEUR?.Treasury!;
2220
}
2321

24-
console.log('Now deploying the Oracle IB01/EUR');
25-
await deploy('Oracle_IB01_EUR', {
26-
contract: `OracleIB01EURChainlink`,
22+
console.log('Now deploying the Oracle HIGH/EUR');
23+
await deploy('Oracle_HIGH_EUR', {
24+
contract: `OracleHIGHEURChainlink`,
2725
from: deployer.address,
28-
args: [3600 * 30, treasury],
26+
// Higher stalePeriod for HIGH
27+
args: [3600 * 24 * 3, treasury],
2928
log: !argv.ci,
3029
});
31-
const oracle = (await deployments.get('Oracle_IB01_EUR')).address;
32-
console.log(`Successfully deployed Oracle IB01/EUR at the address ${oracle}`);
30+
const oracle = (await deployments.get('Oracle_HIGH_EUR')).address;
31+
console.log(`Successfully deployed Oracle HIGH/EUR at the address ${oracle}`);
3332
console.log('');
3433

35-
await deploy('Oracle_USDC_EUR', {
36-
contract: `OracleUSDCEURChainlink`,
34+
console.log('Now deploying the Oracle IB01/EUR');
35+
await deploy('Oracle_IB01_EUR', {
36+
contract: `OracleIB01EURChainlink`,
3737
from: deployer.address,
38-
args: [3600 * 30, treasury],
38+
// Higher stalePeriod for IB01
39+
args: [3600 * 24 * 3, treasury],
3940
log: !argv.ci,
4041
});
41-
const oracle2 = (await deployments.get('Oracle_USDC_EUR')).address;
42-
console.log(`Successfully deployed Oracle USDC/EUR at the address ${oracle2}`);
42+
const oracle2 = (await deployments.get('Oracle_IB01_EUR')).address;
43+
console.log(`Successfully deployed Oracle IB01/EUR at the address ${oracle2}`);
4344
console.log('');
44-
4545
const oracleContract = new ethers.Contract(
4646
oracle,
4747
OracleIB01EURChainlink__factory.createInterface(),

deploy/6_vaultManagerProxy.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
1515
/**
1616
* TODO: change implementation depending on what is being deployed
1717
*/
18+
const implementationName = 'VaultManager_PermissionedLiquidations_Implementation';
19+
// const implementation = (await ethers.getContract(implementationName)).address;
20+
const implementation = '0x88fE06D438F5264dA8e2CDCAc3DAED1eA70F995a';
21+
1822
const { deploy } = deployments;
1923
const { deployer } = await ethers.getNamedSigners();
2024

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

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

67-
const implementation = (await ethers.getContract('VaultManager_PermissionedLiquidations_Implementation')).address;
6871
const callData = new ethers.Contract(
6972
implementation,
7073
VaultManager__factory.createInterface(),
@@ -93,5 +96,5 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
9396
};
9497

9598
func.tags = ['vaultManagerProxy'];
96-
// func.dependencies = ['vaultManagerImplementation'];
99+
func.dependencies = ['oracle'];
97100
export default func;

deploy/networks/hardhat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"oneInchRouter": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
1010
"angleRouter": "0xBB755240596530be0c1DE5DFD77ec6398471561d",
1111
"dust": "0",
12-
"vaultsList": ["USDC"]
12+
"vaultsList": ["bHIGH"]
1313
}

deploy/networks/mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"oneInchRouter": "0x1111111254EEB25477B68fb85Ed929f73A960582",
1010
"angleRouter": "0xBB755240596530be0c1DE5DFD77ec6398471561d",
1111
"dust": "0",
12-
"vaultsList": ["bIB01"]
12+
"vaultsList": ["bHIGH"]
1313
}

deployments/mainnet/Oracle_HIGH_EUR.json

Lines changed: 247 additions & 0 deletions
Large diffs are not rendered by default.

deployments/mainnet/Oracle_IB01_EUR.json

Lines changed: 18 additions & 18 deletions
Large diffs are not rendered by default.

deployments/mainnet/VaultManager_bHIGH_EUR.json

Lines changed: 247 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)