which means pool.depositData.totalAmount = pool.depositData.totalAmount -(principalPaid - interestPaid); the issue is we can not make sure principalPaid larger than principalPaid.
LoanManager# repayWithCollateral will call updateWithRepayWithCollateral. Let's dive into function executeRepay
from the logic calculate interestPaid and principalPaid , when repay, the interest is first calculated and can not make sure interestPaid < principalPaid , in some situation, principalPaid equals 0 is possible.
modify:
Impact Details
repayWithCollateral may get dos when repay small amount of token, in some situation, user try to repay samll amount of token to get
avoid to be liquidated ,funciton could not work, and cause user funds get liquidated and lost