20,000 USDC
View results
Submission Details
Severity: medium

Interest calculation maybe 0

Summary

The interest calculation maybe to 0 if timeElapsed is too short.

Vulnerability Details

The interest calculation formula: interest = (l.interestRate * l.debt * timeElapsed) / 10000 / 365 days; may be 0 if timeElapsed is too short which would cause interest calculation error and cause the lenders or borrowers to lose money.

Impact

Lenders or borrowers can lose money if interest calculation is 0.

Tools Used

vscode, Manual Review

Recommendations

Change the formula to make sure interest calculation is not 0 even if timeElapsed is too short.

Support

FAQs

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

Give us feedback!