-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emode category for v3 config engine (#97)
* cherry pick commit from gauntlet * fix: keep current address * fix: keep current string * fix: use safecast * fix: execute emode update first * fix: liqBonus * test: _validateEmodeCategory * test: eModeCategoryUpdate * docs: fix * fix: reserveFlashLoaning and RF on engine * test: config engine fixes and refactor * chore: update diffs reports and ir * docs: update ReadMe * docs: fix some comments * fix: compiler warning * fix: require message * fix: codesize by making variables internal * feat: split the engine into libraries * fix: make variables public again and fix interface * fix: use engine libs as immutables * docs: some comments * fix: use calldata * fix: interface * fix: listAssets using libs * fix: change function visibility to external * fix: revert listAssets from libs * fix: lint and some refactoring * feat: seperate e-mode asset update from collateral update * docs: update Readme * test: emode category update of an asset * refactor: get engine constants in struct * fix: script * fix: single entry point for engine libs * refactor: some cleanup * refactor: cleanup * chore: via-ir config for build * chore: update libs * docs: some comments * fix: remove tokenImpls from engine constants * fix: require on borrow engine * refactor: rateEngine EModeEngine * fix: pragma version * fix: require on rate engine * test: engine e-mode category no change * fix: repack struct (#111) * fix: repack struct * fix: add prefix * fix: typo * run tests after merge * chore: soften solidity version on swapper and bridge --------- Co-authored-by: Jonathan Reem <[email protected]> Co-authored-by: Lukas <[email protected]> Co-authored-by: Rustem Kurmaev <[email protected]>
- Loading branch information
1 parent
8460740
commit 88ccbc4
Showing
94 changed files
with
11,281 additions
and
3,181 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,89 +1,5 @@ | ||
## Reserve changes | ||
|
||
### Reserve altered | ||
|
||
#### WETH ([0x82aF49447D8a07e3bd95BD0d56f35241523fBab1](https://arbiscan.io/address/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 10 % | 15 % | | ||
| interestRateStrategy | [0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f](https://arbiscan.io/address/0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f) | [0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F](https://arbiscan.io/address/0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F) | | ||
| optimalUsageRatio | 45 % | 80 % | | ||
| maxExcessUsageRatio | 55 % | 20 % | | ||
| baseVariableBorrowRate | 0 % | 1 % | | ||
| variableRateSlope1 | 7 % | 3.8 % | | ||
| variableRateSlope2 | 300 % | 80 % | | ||
| baseStableBorrowRate | 9 % | 6.8 % | | ||
| stableRateSlope1 | 0 % | 4 % | | ||
| stableRateSlope2 | 0 % | 80 % | | ||
| interestRate | ![before](/.assets/19b2f23d55d76d891e7d30c29aa97741efed9d17.svg) | ![after](/.assets/25b7cbb97d2012b141455f46ee9b3f7e0e40a4b0.svg) | | ||
|
||
#### EURS ([0xD22a58f79e9481D1a88e00c343885A588b34b68B](https://arbiscan.io/address/0xD22a58f79e9481D1a88e00c343885A588b34b68B)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| interestRateStrategy | [0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4](https://arbiscan.io/address/0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4) | [0xA9F3C3caE095527061e6d270DBE163693e6fda9D](https://arbiscan.io/address/0xA9F3C3caE095527061e6d270DBE163693e6fda9D) | | ||
| optimalUsageRatio | 90 % | 80 % | | ||
| maxExcessUsageRatio | 10 % | 20 % | | ||
| variableRateSlope2 | 60 % | 75 % | | ||
| stableRateSlope2 | 60 % | 75 % | | ||
| interestRate | ![before](/.assets/ea60696e57315a00b0941d7fe1bd186df779165e.svg) | ![after](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | | ||
|
||
#### USDT ([0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9](https://arbiscan.io/address/0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| interestRateStrategy | [0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4](https://arbiscan.io/address/0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4) | [0xA9F3C3caE095527061e6d270DBE163693e6fda9D](https://arbiscan.io/address/0xA9F3C3caE095527061e6d270DBE163693e6fda9D) | | ||
| optimalUsageRatio | 90 % | 80 % | | ||
| maxExcessUsageRatio | 10 % | 20 % | | ||
| variableRateSlope2 | 60 % | 75 % | | ||
| stableRateSlope2 | 60 % | 75 % | | ||
| interestRate | ![before](/.assets/ea60696e57315a00b0941d7fe1bd186df779165e.svg) | ![after](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | | ||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": { | ||
"interestRateStrategy": { | ||
"from": "0x9b34E3e183c9b0d1a08fF57a8fb59c821616295f", | ||
"to": "0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F" | ||
}, | ||
"reserveFactor": { | ||
"from": 1000, | ||
"to": 1500 | ||
} | ||
}, | ||
"0xD22a58f79e9481D1a88e00c343885A588b34b68B": { | ||
"interestRateStrategy": { | ||
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4", | ||
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D" | ||
} | ||
}, | ||
"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9": { | ||
"interestRateStrategy": { | ||
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4", | ||
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D" | ||
} | ||
} | ||
}, | ||
"strategies": { | ||
"0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F": { | ||
"from": null, | ||
"to": { | ||
"baseStableBorrowRate": "68000000000000000000000000", | ||
"baseVariableBorrowRate": "10000000000000000000000000", | ||
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000", | ||
"maxExcessUsageRatio": "200000000000000000000000000", | ||
"optimalStableToTotalDebtRatio": "200000000000000000000000000", | ||
"optimalUsageRatio": "800000000000000000000000000", | ||
"stableRateSlope1": "40000000000000000000000000", | ||
"stableRateSlope2": "800000000000000000000000000", | ||
"variableRateSlope1": "38000000000000000000000000", | ||
"variableRateSlope2": "800000000000000000000000000" | ||
} | ||
} | ||
} | ||
} | ||
{} | ||
``` |
25 changes: 25 additions & 0 deletions
25
diffs/preTestEngineAssetEModeUpdate_postTestEngineAssetEModeUpdate.md
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,25 @@ | ||
## Reserve changes | ||
|
||
### Reserves altered | ||
|
||
#### rETH ([0xae78736Cd615f374D3085123A210448E74Fc6393](https://etherscan.io/address/0xae78736Cd615f374D3085123A210448E74Fc6393)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| eModeCategory | 0 | 1 | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0xae78736Cd615f374D3085123A210448E74Fc6393": { | ||
"eModeCategory": { | ||
"from": 0, | ||
"to": 1 | ||
} | ||
} | ||
} | ||
} | ||
``` |
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 |
---|---|---|
@@ -1,111 +1,5 @@ | ||
## Reserve changes | ||
|
||
### Reserve altered | ||
|
||
#### WETH.e ([0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB](https://snowtrace.io/address/0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 10 % | 15 % | | ||
| interestRateStrategy | [0x79a906e8c998d2fb5C5D66d23c4c5416Fe0168D6](https://snowtrace.io/address/0x79a906e8c998d2fb5C5D66d23c4c5416Fe0168D6) | [0xc76EF342898f1AE7E6C4632627Df683FAD8563DD](https://snowtrace.io/address/0xc76EF342898f1AE7E6C4632627Df683FAD8563DD) | | ||
| optimalUsageRatio | 45 % | 80 % | | ||
| maxExcessUsageRatio | 55 % | 20 % | | ||
| baseVariableBorrowRate | 0 % | 1 % | | ||
| variableRateSlope1 | 7 % | 3.8 % | | ||
| variableRateSlope2 | 300 % | 80 % | | ||
| baseStableBorrowRate | 9 % | 6.8 % | | ||
| stableRateSlope1 | 0 % | 4 % | | ||
| stableRateSlope2 | 0 % | 80 % | | ||
| interestRate | ![before](/.assets/19b2f23d55d76d891e7d30c29aa97741efed9d17.svg) | ![after](/.assets/25b7cbb97d2012b141455f46ee9b3f7e0e40a4b0.svg) | | ||
|
||
#### MAI ([0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b](https://snowtrace.io/address/0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 10 % | 20 % | | ||
| interestRateStrategy | [0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82](https://snowtrace.io/address/0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82) | [0xfab05a6aF585da2F96e21452F91E812452996BD3](https://snowtrace.io/address/0xfab05a6aF585da2F96e21452F91E812452996BD3) | | ||
| optimalUsageRatio | 90 % | 80 % | | ||
| maxExcessUsageRatio | 10 % | 20 % | | ||
| variableRateSlope2 | 60 % | 75 % | | ||
| stableRateSlope2 | 60 % | 75 % | | ||
| interestRate | ![before](/.assets/ea60696e57315a00b0941d7fe1bd186df779165e.svg) | ![after](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | | ||
|
||
#### USDt ([0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7](https://snowtrace.io/address/0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| interestRateStrategy | [0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82](https://snowtrace.io/address/0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82) | [0xfab05a6aF585da2F96e21452F91E812452996BD3](https://snowtrace.io/address/0xfab05a6aF585da2F96e21452F91E812452996BD3) | | ||
| optimalUsageRatio | 90 % | 80 % | | ||
| maxExcessUsageRatio | 10 % | 20 % | | ||
| variableRateSlope2 | 60 % | 75 % | | ||
| stableRateSlope2 | 60 % | 75 % | | ||
| interestRate | ![before](/.assets/ea60696e57315a00b0941d7fe1bd186df779165e.svg) | ![after](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | | ||
|
||
#### FRAX ([0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64](https://snowtrace.io/address/0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| interestRateStrategy | [0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82](https://snowtrace.io/address/0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82) | [0xfab05a6aF585da2F96e21452F91E812452996BD3](https://snowtrace.io/address/0xfab05a6aF585da2F96e21452F91E812452996BD3) | | ||
| optimalUsageRatio | 90 % | 80 % | | ||
| maxExcessUsageRatio | 10 % | 20 % | | ||
| variableRateSlope2 | 60 % | 75 % | | ||
| stableRateSlope2 | 60 % | 75 % | | ||
| interestRate | ![before](/.assets/ea60696e57315a00b0941d7fe1bd186df779165e.svg) | ![after](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | | ||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB": { | ||
"interestRateStrategy": { | ||
"from": "0x79a906e8c998d2fb5C5D66d23c4c5416Fe0168D6", | ||
"to": "0xc76EF342898f1AE7E6C4632627Df683FAD8563DD" | ||
}, | ||
"reserveFactor": { | ||
"from": 1000, | ||
"to": 1500 | ||
} | ||
}, | ||
"0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b": { | ||
"interestRateStrategy": { | ||
"from": "0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82", | ||
"to": "0xfab05a6aF585da2F96e21452F91E812452996BD3" | ||
}, | ||
"reserveFactor": { | ||
"from": 1000, | ||
"to": 2000 | ||
} | ||
}, | ||
"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7": { | ||
"interestRateStrategy": { | ||
"from": "0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82", | ||
"to": "0xfab05a6aF585da2F96e21452F91E812452996BD3" | ||
} | ||
}, | ||
"0xD24C2Ad096400B6FBcd2ad8B24E7acBc21A1da64": { | ||
"interestRateStrategy": { | ||
"from": "0xf4a0039F2d4a2EaD5216AbB6Ae4C4C3AA2dB9b82", | ||
"to": "0xfab05a6aF585da2F96e21452F91E812452996BD3" | ||
} | ||
} | ||
}, | ||
"strategies": { | ||
"0xc76EF342898f1AE7E6C4632627Df683FAD8563DD": { | ||
"from": null, | ||
"to": { | ||
"baseStableBorrowRate": "68000000000000000000000000", | ||
"baseVariableBorrowRate": "10000000000000000000000000", | ||
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000", | ||
"maxExcessUsageRatio": "200000000000000000000000000", | ||
"optimalStableToTotalDebtRatio": "200000000000000000000000000", | ||
"optimalUsageRatio": "800000000000000000000000000", | ||
"stableRateSlope1": "40000000000000000000000000", | ||
"stableRateSlope2": "800000000000000000000000000", | ||
"variableRateSlope1": "38000000000000000000000000", | ||
"variableRateSlope2": "800000000000000000000000000" | ||
} | ||
} | ||
} | ||
} | ||
{} | ||
``` |
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
5 changes: 5 additions & 0 deletions
5
diffs/preTestEngineEModeCategoryNoChange_postTestEngineEModeCategoryNoChange.md
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,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
22 changes: 22 additions & 0 deletions
22
diffs/preTestEngineEModeCategoryUpdate_postTestEngineEModeCategoryUpdate.md
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,22 @@ | ||
## Raw diff | ||
|
||
```json | ||
{ | ||
"eModes": { | ||
"1": { | ||
"liquidationBonus": { | ||
"from": 10100, | ||
"to": 10150 | ||
}, | ||
"liquidationThreshold": { | ||
"from": 9750, | ||
"to": 9760 | ||
}, | ||
"ltv": { | ||
"from": 9700, | ||
"to": 9740 | ||
} | ||
} | ||
} | ||
} | ||
``` |
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
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
Oops, something went wrong.
88ccbc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈