During the deposit process in the lending protocol, the number of RTokens minted is dynamically calculated using a non-static liquidity index (reserve.liquidityIndex
). This logic does not enforce a minimum receipt threshold (i.e., the minimum amount of RTokens the user must receive). As a result, if the liquidity index changes unexpectedly between state updates or due to accrued interest, a user’s minted RTokens may be lower than anticipated relative to their deposited crvUSD
. This discrepancy can lead to a loss in value for the depositor.
The deposit routine uses the current reserve.liquidityIndex
to calculate the scaled amount for minting RTokens. This index is not a constant value; it is influenced by interest accrual over time. During the execution of transactions, the index might change, causing the minted token amount to differ from what the depositor would expect based on the deposited crvUSD value.
RToken contract
Is changing not static getNormalizedIncome()
The deposit function does not include a mechanism for specifying or enforcing a minimum number of RTokens to be received by a user. Without such a safeguard, fluctuations in the liquidity index can result in a scenario where the depositor ends up receiving a lower number of RTokens
than anticipated, effectively losing part of the deposited value.
Depositors may experience an unintended loss of value since the number of RTokens minted does not correctly represent the intended conversion of crvUSD value.
Manual Review
Add an additional parameter to the deposit()
function (and propagate it to the ReserveLibrary.deposit()
) that allows the depositor to specify a minimum acceptable amount of RTokens to mint. If the calculated mintedAmount
is below this threshold, the transaction should revert.
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.