Skip to content

Commit

Permalink
fix: Remove duplicated code in LiquidationLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Dec 2, 2021
1 parent 3729466 commit 2189ba4
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions contracts/protocol/libraries/logic/LiquidationLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ library LiquidationLogic {
vars.actualDebtToLiquidate,
vars.debtReserveCache.nextVariableBorrowIndex
);

debtReserve.updateInterestRates(
vars.debtReserveCache,
params.debtAsset,
vars.actualDebtToLiquidate,
0
);
} else {
// If the user doesn't have variable debt, no need to try to burn variable debt tokens
if (vars.userVariableDebt > 0) {
Expand All @@ -189,14 +182,13 @@ library LiquidationLogic {
params.user,
vars.actualDebtToLiquidate - vars.userVariableDebt
);

debtReserve.updateInterestRates(
vars.debtReserveCache,
params.debtAsset,
vars.actualDebtToLiquidate,
0
);
}
debtReserve.updateInterestRates(
vars.debtReserveCache,
params.debtAsset,
vars.actualDebtToLiquidate,
0
);

if (params.receiveAToken) {
vars.liquidatorPreviousATokenBalance = IERC20(vars.collateralAtoken).balanceOf(msg.sender);
Expand Down

0 comments on commit 2189ba4

Please sign in to comment.