The _mint()
function in RToken
contract, does not account for balanceIncrease
, causing accrued interest to be lost when updating _userState[onBehalfOf].index
.
In the mint()
function, the accrued interest (balanceIncrease
) is calculated as:
However, balanceIncrease
is not added to amountToMint
when calling _mint()
:
Since _userState[onBehalfOf].index
is updated right after:
This means that any previously accrued interest (balanceIncrease
) is effectively reset and lost, leading to incorrect interest calculations for users.
Users will lose the interest accrued before the current minting transaction, leading to an underestimation of their balance and overall yield loss.
Manual Review
Update _mint()
to include balanceIncrease
, ensuring users receive their full entitled interest before resetting _userState[onBehalfOf].index
.
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.