Skip to content

Commit

Permalink
Improved comment on _updateIndexes()
Browse files Browse the repository at this point in the history
  • Loading branch information
eboadom committed Nov 9, 2022
1 parent efdaf63 commit 94f0843
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/protocol/libraries/logic/ReserveLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ library ReserveLogic {
}

// Variable borrow index only gets updated if there is any variable debt.
// We assume that in that case the variable borrow rate is positive, to avoid
// over-optimization
// reserveCache.currVariableBorrowRate != 0 is not a correct validation,
// because a positive base variable rate can be stored on
// reserveCache.currVariableBorrowRate, but the index should not increase
if (reserveCache.currScaledVariableDebt != 0) {
uint256 cumulatedVariableBorrowInterest = MathUtils.calculateCompoundedInterest(
reserveCache.currVariableBorrowRate,
Expand Down

0 comments on commit 94f0843

Please sign in to comment.