The DebtToken.mint() function currently returns totalSupply() as its last return value. Instead, it should return scaledTotalSupply().
The last return value of the DebtToken.mint() function is totalSupply(), which is incorrect. It should return scaledTotalSupply() instead.
In the LendingPool.borrow() function, newTotalSupply is assigned the last return value of the DebtToken.mint() function and is used to update reserve.totalUsage. Since reserve.totalUsage indicates the total amount borrowers should repay in the units of the underlying reserve token, newTotalSupply must reflect this value. However, since DebtToken.mint() returns totalSupply(), which is not in the units of the underlying reserve token, the reserve state of the LendingPool is updated incorrectly, leading to erroneous behaviors within the protocol.
The reserve state of the LendingPool is updated incorrectly, resulting in adverse effects on the entire protocol.
Manual review
Return scaledTotalSupply() instead of totalSupply() to ensure accurate updates.
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.