GalloDaSballo / Apollon-Review

Notes for the Apollon Solo Security Review
0 stars 0 forks source link

`TroveManager``_calcBorrowingRate` always returns `borrowingFeeFloor` #63

Open GalloDaSballo opened 2 months ago

GalloDaSballo commented 2 months ago

Impact

_calcBorrowingRate is using min(X + Y, X) meaning it will always return X in this case borrowingFeeFloor

Mitigation

Change

  function _calcBorrowingRate(uint _stableCoinBaseRate) internal view returns (uint) {
    return LiquityMath._min(borrowingFeeFloor + _stableCoinBaseRate, borrowingFeeFloor);
  }

To

  function _calcBorrowingRate(uint _stableCoinBaseRate) internal view returns (uint) {
    return LiquityMath._min(borrowingFeeFloor + _stableCoinBaseRate, 1e18);
  }
sambP commented 2 months ago
Screenshot 2024-08-27 at 2 53 35 PM