Skip to content

Commit

Permalink
fix: use internal constant for max borrow rate
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Aug 7, 2024
1 parent 586c327 commit 5cefb60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/contracts/misc/GhoAaveSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,9 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward {
'INVALID_VARIABLE_RATE_SLOPE2'
);

uint256 maxBorrowRate = IDefaultInterestRateStrategyV2(
ghoReserveData.interestRateStrategyAddress
).MAX_BORROW_RATE();
require(
uint256(baseVariableBorrowRate) + uint256(variableRateSlope1) + uint256(variableRateSlope2) <=
maxBorrowRate,
GHO_BORROW_RATE_MAX / 1e23,
'BORROW_RATE_HIGHER_THAN_MAX'
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/TestGhoAaveSteward.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract TestGhoAaveSteward is TestGhoBase {
update[0].asset = address(GHO_TOKEN);
update[0].params = MockConfigEngine.InterestRateInputData({
optimalUsageRatio: 1_00,
baseVariableBorrowRate: 0.25e4,
baseVariableBorrowRate: 0.20e4,
variableRateSlope1: 0,
variableRateSlope2: 0
});
Expand Down Expand Up @@ -305,11 +305,11 @@ contract TestGhoAaveSteward is TestGhoBase {
vm.prank(RISK_COUNCIL);
GHO_AAVE_STEWARD.updateGhoBorrowRate(
defaultRateParams.optimalUsageRatio,
0.26e4,
0.21e4,
defaultRateParams.variableRateSlope1,
defaultRateParams.variableRateSlope2
);
assertEq(_getGhoBorrowRate(), 0.26e4);
assertEq(_getGhoBorrowRate(), 0.21e4);
}

function testUpdateGhoBorrowRateUpwards() public {
Expand Down

0 comments on commit 5cefb60

Please sign in to comment.