20,000 USDC
View results
Submission Details
Severity: low

wrongly calculating interest in _calculateInterest function

Summary

Interest calculated for an loan is wrongly calculated.

Vulnerability Details

using simple interest formula PTR/100
where
P = debt
T = timeElapsed
R = interestRate
but an year doesn't always have a 365 days. So the final calculated interest is wrongly calculated.
On leap years, the number of days is 366, so calculations during those years will return the wrong value

Impact

Tools Used

Recommendations

Support

FAQs

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

Give us feedback!