20,000 USDC
View results
Submission Details
Severity: high
Valid

Giving a loan to a new pool is removing totalDebt that is incorrect

Summary

Giving a loan to a new pool is removing totalDebt that is incorrect

Vulnerability Details

Updating the balance of the new pool is removing the total Debt that is the sum of loan.debt + lenderInterest + protocolInterest, but it needs to be only the loan.debt. This way from loan.debt(e.g. 1000 tokens) the user will get new debt which will be 1050.

Impact

Loss of funds

Tools Used

Manual Review

Recommendations

Give the user only loan.debt, and remove from the poolBalance only loan.debt not totalDebt

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.