The totalSupply function in the DebtToken contract contains an implementation flaw. Instead of returning the scaled total supply by multiplying the scaled balance with the normalized debt, it incorrectly attempts to divide the total supply by the normalized debt. This error can lead to incorrect calculations in functionality that relies on this result, potentially causing economic losses for users.
The current implementation computes the total supply using division instead of the correct scaling methodology, which involves multiplication. Specifically, it attempts to return scaledSupply.rayDiv(ILendingPool(_reservePool).getNormalizedDebt()) instead of the appropriate scaledBalance.rayMul(ILendingPool(_reservePool).getNormalizedDebt()).
The impact of this vulnerability is significant, as it could lead to users and other dependent contracts making decisions based on erroneously reported total supply values. This could result in economic losses.
The correct implementation should use multiplication as follows:
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.