Skip to content

Commit

Permalink
⚡️ (#1303) Small opti
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite authored and pakim249CAL committed Sep 23, 2022
1 parent 8a95bf7 commit fe4e881
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/aave-v2/ExitPositionsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ contract ExitPositionsManager is IExitPositionsManager, PositionsManagerUtils {

LiquidateVars memory vars;
if (!borrowedMarket.isDeprecated) {
vars.closeFactor = DEFAULT_LIQUIDATION_CLOSE_FACTOR;
if (!_liquidationAllowed(_borrower)) revert UnauthorisedLiquidate();
vars.closeFactor = DEFAULT_LIQUIDATION_CLOSE_FACTOR;
} else vars.closeFactor = MAX_BASIS_POINTS; // Allow liquidation of the whole debt.

address tokenBorrowedAddress = market[_poolTokenBorrowed].underlyingToken;
Expand Down
2 changes: 1 addition & 1 deletion contracts/compound/PositionsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ contract PositionsManager is IPositionsManager, MatchingEngine {

uint256 closeFactor;
if (!borrowedMarket.isDeprecated) {
closeFactor = comptroller.closeFactorMantissa();
if (!_isLiquidatable(_borrower, address(0), 0, 0)) revert UnauthorisedLiquidate();
closeFactor = comptroller.closeFactorMantissa();
} else closeFactor = WAD; // Allow liquidation of the whole debt.

LiquidateVars memory vars;
Expand Down

0 comments on commit fe4e881

Please sign in to comment.