mint function in RToken.sol mints the raw amountToMint instead of the scaled amount (amountScaled), leading to over-withdrawal when the liquidity index increases. This violates the core design of interest-bearing tokens, where balances should be stored in scaled terms to properly account for interest accrualInitial State:
index = 1.1 RAY (after interest accrual)
User deposits 100 underlying tokens.
Flawed Execution:
amountToMint = 100
amountScaled = 100 / 1.1 ≈ 90.909 (correct scaled amount)
Actual Mint: 100 tokens (raw amount stored)
Expected Mint: 90.909 tokens (scaled)
Index Increases Further:
New index = 1.2 RAY.
User Withdraws:
Actual Balance: 100 * 1.2 = 120
Expected Balance: 90.909 * 1.2 ≈ 109.09
the code should mint the amout/index instead of raw amount
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.