The mint function in the RToken contract does not account for accrued interest on existing tokens when a user makes a repeated deposit. As a result, users lose out on earned interest when depositing additional funds into the protocol.
The issue occurs in the mint function of the RToken contract. When a user deposits funds, the function calculates the accrued interest (balanceIncrease) on their existing tokens but fails to add this amount to the newly minted tokens (amountToMint). Instead, it only mints tokens equivalent to the deposited amount, ignoring the accrued interest.
The function calculates balanceIncrease (accrued interest) but does not include it in the amountToMint parameter passed to _mint. As a result, the accrued interest is effectively lost when a user makes a repeated deposit.
Users lose accrued interest on their existing tokens when making repeated deposits.
Manual code review.
To fix this issue, the accrued interest (balanceIncrease) should be added to the amountToMint before calling _mint.
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.