Skip to content

Commit

Permalink
added 0 shares check in liquidate() #101
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMoaz committed Jun 15, 2023
1 parent 9492d03 commit 2dd4702
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ contract Pool {
collateralReward = _amount * userInvertedCollateralRatioMantissa / 1e18; // rounds down
_shares = tokenToShares(_amount, _currentTotalDebt, _debtSharesSupply, false);
}

require(_shares != 0, "Pool: zero shares to liquidate");
_currentTotalDebt -= _amount;

// commit current state
Expand Down

0 comments on commit 2dd4702

Please sign in to comment.