Skip to content

Commit b8e1226

Browse files
feat: Vault manager with permissioned liquidations (#208)
* first batch of test done * update final hash of vaultManager implementation * changing whitelist * feat: add tests for whitelisted vault * vaultManager for IB01 * fix: comments for liquidations * add USDC collateral * feat: add debt ceiling vault * feat: vaultManager deployment --------- Co-authored-by: gs8nrv <[email protected]>
1 parent df978a3 commit b8e1226

35 files changed

+3811
-2910
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ bin
4848

4949
# temporary delete
5050
typechain/cacheIndex.ts
51-
contracts/mock/MockEulerReactor.sol
5251

5352
# foundry
5453
/out

.solcover.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = {
1313
'oracle/implementations/',
1414
// Router here is a copy pasta of the router in another repo
1515
'router',
16-
'reactor/BaseReactorStorage.sol',
1716
'vaultManager/VaultManagerStorage.sol',
1817
'keeperMulticall/KeeperMulticall.sol',
1918
],

.solhint.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@
22
"extends": "solhint:recommended",
33
"plugins": ["prettier"],
44
"rules": {
5-
"prettier/prettier": "warning",
5+
"avoid-call-value": "warn",
6+
"avoid-low-level-calls": "off",
7+
"avoid-tx-origin": "warn",
8+
"const-name-snakecase": "warn",
9+
"contract-name-camelcase": "warn",
10+
"imports-on-top": "warn",
11+
"prettier/prettier": "off",
612
"ordering": "off",
13+
"max-states-count": "off",
714
"mark-callable-contracts": "off",
815
"no-empty-blocks": "off",
16+
"no-global-import": "off",
917
"not-rely-on-time": "off",
1018
"compiler-version": "off",
11-
"private-vars-leading-underscore": "error",
19+
"private-vars-leading-underscore": "warn",
20+
"reentrancy": "warn",
21+
"no-inline-assembly": "off",
22+
"no-complex-fallback": "off",
1223
"reason-string": "off",
13-
"func-visibility": ["error", { "ignoreConstructors": true }]
24+
"func-visibility": ["warn", { "ignoreConstructors": true }]
1425
}
1526
}

contracts/mock/MockReactor.sol

Lines changed: 0 additions & 36 deletions
This file was deleted.

contracts/oracle/BaseOracleChainlinkMulti.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ abstract contract BaseOracleChainlinkMulti is IOracle {
9999
revert InvalidChainlinkRate();
100100
uint256 castedRatio = uint256(ratio);
101101
// Checking whether we should multiply or divide by the ratio computed
102-
if (multiplied == 1) return (quoteAmount * castedRatio) / (10**decimals);
103-
else return (quoteAmount * (10**decimals)) / castedRatio;
102+
if (multiplied == 1) return (quoteAmount * castedRatio) / (10 ** decimals);
103+
else return (quoteAmount * (10 ** decimals)) / castedRatio;
104104
}
105105

106106
// ======================= Governance Related Functions ========================
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 OracleIB01EURChainlink
10+
/// @author Angle Labs, Inc.
11+
/// @notice Gives the price of IB01 in Euro in base 18
12+
contract OracleIB01EURChainlink is BaseOracleChainlinkMultiTwoFeeds {
13+
string public constant DESCRIPTION = "IB01/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[](2);
20+
// Oracle IB01/USD
21+
_circuitChainlink[0] = AggregatorV3Interface(0x788D911ae7c95121A89A0f0306db65D87422E1de);
22+
// Oracle EUR/USD
23+
_circuitChainlink[1] = AggregatorV3Interface(0xb49f677943BC038e9857d61E7d053CaA2C1734C1);
24+
return _circuitChainlink;
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 OracleUSDCEURChainlink
10+
/// @author Angle Labs, Inc.
11+
/// @notice Gives the price of USDC in Euro in base 18
12+
contract OracleUSDCEURChainlink is BaseOracleChainlinkMultiTwoFeeds {
13+
string public constant DESCRIPTION = "USDC/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[](2);
20+
// Oracle USDC/USD
21+
_circuitChainlink[0] = AggregatorV3Interface(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6);
22+
// Oracle EUR/USD
23+
_circuitChainlink[1] = AggregatorV3Interface(0xb49f677943BC038e9857d61E7d053CaA2C1734C1);
24+
return _circuitChainlink;
25+
}
26+
}

0 commit comments

Comments
 (0)