The getNormalizedDebt function returns an incorrect value when timeDelta
equals zero. This leads to an incorrect calculation of the normalized debt, potentially causing inconsistencies in the protocol's financial operations.
The ReserveLibrary::getNormalizedDebt
function is intended to return the updated reserve.usageIndex
variable. However, in the case where timeDelta
equals zero, it incorrectly returns the reserve.totalUsage
variable instead of the reserve.usageIndex
.
Returning reserve.totalUsage instead of reserve.usageIndex when timeDelta is zero results in an inaccurate debt calculation.
Manual code review
modify the function to return reserve.usageIndex when timeDelta is zero:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.