Skip to content

Commit

Permalink
fix: Optimize gho debt balanceof (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf authored Feb 20, 2023
1 parent 81bb51b commit 5dc045b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ contract GhoVariableDebtToken is DebtTokenBase, ScaledBalanceTokenBase, IGhoVari
uint256 discountPercent = _ghoUserState[user].discountPercent;
if (discountPercent != 0) {
uint256 balanceIncrease = balance - scaledBalance.rayMul(previousIndex);
uint256 discount = balanceIncrease.percentMul(discountPercent);
balance = balance - discount;
balance -= balanceIncrease.percentMul(discountPercent);
}

return balance;
Expand Down

0 comments on commit 5dc045b

Please sign in to comment.