The RToken mint() function in the LendingPool contract incorrectly handles interest accrual during token minting. When users deposit assets, the contract mints RTokens without properly accounting for the current interest index, leading to incorrect token distribution and potential economic vulnerabilities.
The issue occurs in the RToken mint() function:
The function correctly calculates the scaled amount but then incorrectly uses the raw amountToMint value when minting tokens. This leads to two issues:
Incorrect Initial Minting: When a user deposits with an index > 1, they receive more RTokens than they should.
Initial State:
Index = 1.5
User deposits 100 crvUSD
Should receive: 100/1.5 = 66.67 rTokens
Actually receives: 100 rTokens
Incorrect Interest Accrual: For users with existing deposits, the interest accrual calculation is present but ineffective since the new tokens are minted at face value.
Scenario:
Index = 1.1, User deposits 100 crvUSD
Should receive: 90.90 rTokens (100/1.1)
Actually receives: 100 rTokens
Index increases to 1.2, User deposits another 100 crvUSD
Should receive: 83.33 rTokens (100/1.2)
Actually receives: 100 rTokens
Missing interest accrual on first deposit
Users receive more RTokens than they should based on the current interest index
Interest accrual mechanism is effectively broken
Manual review
The mint function should be modified to use the scaled amount when minting tokens and include the balance increase to account for any interest accrued.
The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.
The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.
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.