On RToken::transfer()
a wrong amount will always be transferred. As the amount
argument is applied twice a rayDiv()
with the liquidity index.
When transfering the first div happens here.
And the second happens in _update()
, here.
This is because transfer calls eventually call update. See OZ ERC20 implementation here.
RToken::transfer()
results always in the receiver receiving less amount.
Only apply the rayDiv()
once, remove the division here. The _update()
div one will now be the only one.
For reference you can see AAVE aToken::ScaledBalanceToken
code, they only apply it once, here. Right before the common ERC20 logic call.
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.