The RToken contract's burn function incorrectly uses rayMul
instead of rayDiv
when calculating the scaled amount
, resulting in inflated burn values that cause users to lose funds by burning more RTokens than necessary for the same amount of underlying assets. This benefits the protocol and remaining RToken holders at the expense of users performing burns.
The calculation multiplies the amount by the index instead of dividing it. Since the liquidity index typically grows over time and is greater than 1 RAY, this results in an inflated amountScaled
value.
Example:
Amount to burn: 100 asset tokens
Current index: 2.0 RAY
Current calculation of RTokens: 100 * 2.0 = 200 (incorrect)
Expected calculation of RTokens: 100 / 2.0 = 50 (correct)
HIGH - Users are losing more Tokens than intended.
Users burning RTokens lose significant value
Less underlying tokens received per RToken burned
The loss increases as the liquidity index grows over time
The protocol unfairly gains value at the expense of users
Replace the rayMul operation with rayDiv
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.