The RToken::mint function returns the values isFirstMint, amountToMint, totalSupply(), and amountScaled sequentially.
However, in the ReserveLibrary::deposit function, which calls RToken::mint, the outputs are stored in variables named isFirstMint, amountScaled, newTotalSupply, and amountUnderlying.
As a result, the actual value of amountToMint is stored in the variable amountScaled, while the actual value of amountScaled is stored in amountUnderlying.
This discrepancy ultimately leads to incorrect emit here.
This can lead to user confusion.
Manual review
Sweep the amountScaled and amountUnderlying in the ReserveLibrary::deposit function.
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.