The totalSupply()
function uses rayDiv
instead of rayMul
when applying the normalized debt index, causing systematic underreporting of total debt.
scaledSupply
tracks total Debt tokens. this should be multiplied by the index to get total Debt.
In the return statement below ,scaledSupply.rayDiv()
inverts the debt accrual logic, making total debt appear to shrink as interest accrues which is wrong. Debt should actually increase over time.
totalSupply() function is used in mint,burn functions and also in other contracts to track the total debt .
This math error causes underreporting of total Debt in multiple places of the codebase.
Manual review
Instead of rayDiv(), we need to call rayMul() on scaledSupply
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.