The RToken contract's mint function returns values in an incorrect sequence compared to its documented return specification. This mismatch between documentation and implementation can lead to incorrect interpretations by calling contracts, particularly the LendingPool, potentially causing accounting errors in the protocol.
LendingPool::deposit --> ReserveLibrary:deposit --> RToken.mint()
LendingPool & ReserveLibrary expect amountScaled
but instead recieve amountToMint
.
severity: HIGH (Likelihood: Always, Impact: High )
The LendingPool contract receives amountToMint
when it expects amountScaled
in the second position
Since scaled amounts are used to track user balances and protocol accounting, this leads to:
Incorrect user balance calculations
Inaccurate interest accrual
Potential loss of funds due to miscalculated withdrawals
Modify the return statement to return correct sequence, as expected.
return (isFirstMint, amountScaled, totalSupply(), amountToMint);
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.