In mint() function in RToken contract the positions of the second and fourth variables are swapped.
The mint function in RToken contract expect to return:
bool: True if this is the first mint for the recipient, false otherwise
uint256: The amount of scaled tokens minted
uint256: The new total supply after minting
uint256: The amount of underlying tokens minted
it retruns:
Second param (amountToMint) is in non-scaled units.
Fourth param (amountScaled) is in underlying units.
The function is expected to return for second position the amount of scaled tokens and for fourth position - minted amount of tokens in underlying units. It returns the opposites
In ReserveLibrary contract deposit() function returns amountMinted tokens. It expects to be in in scaled units, at row 337:
It will update the liquidity and return wrong values.
To fix the issue you should change the position for the returned values in mint() function like this:
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.