The updateLiquidityIndex() function in RToken contract is meant be only be called by the reserve pool contract. However, there is no such functionality implemented there to invoke it. This means that once initialized, the liquidity index used during transferFrom operations will remain constant throughout the contract liferime.
In RToken contract, _liquidityIndex is initialized as follows:
This liquidity index is then used in transferFrom() function as shown here:
The protocol further implements a setter function for the liquidity index as shown here:
The onlyReservePool modifier ensures that this function can only be called from the reserve pool (lending pool). However, there is no such functionality in lending pool that invokes this update function.
The lending pool mostly interacts with the ReserveLibrary.updateReserveState() to update the liquidityIndex for reserves during operations such as deposit, withdrawal, borrowing, liquidation etc as shown here:
However after this is updated, it does not proceed to update it in the RToken contract.
In contrast, the transfer() function utilizes the updated liquidityIndex by fetching it directly during the operation:
This ensures that all transfers are based on the current accurate liquidity index while the approach in transferFrom() does not.
All transferFrom operations therefore in RToken will be performed based on the liquidity index set during initialization throughout the lifetime of the contract without any means to make modifications to it. This goes against the intended objective of the protocol.
Manual Review
Implement a functionality in lending pool to invoke the updateLiquidityIndex() in RToken contract or modify the transferFrom() as shown here.
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.