Skip to content

Commit

Permalink
fix: issue-86
Browse files Browse the repository at this point in the history
  • Loading branch information
fann95 committed Oct 31, 2023
1 parent c577040 commit 7937e25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/LiquidityBorrowingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ contract LiquidityBorrowingManager is
cache.dailyRateCollateral *
Constants.COLLATERAL_BALANCE_PRECISION;
// Checking if borrowing marginDeposit exceeds the maximum allowed
uint256 marginDeposit = cache.borrowedAmount - cache.holdTokenBalance;
uint256 marginDeposit = cache.borrowedAmount > cache.holdTokenBalance
? cache.borrowedAmount - cache.holdTokenBalance
: 0;
(marginDeposit > params.maxMarginDeposit).revertError(
ErrLib.ErrorCode.TOO_BIG_MARGIN_DEPOSIT
);
Expand Down

0 comments on commit 7937e25

Please sign in to comment.