Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

Impossible to update liquidity index within RToken contract

Summary

There is updateLiquidityIndex() within RToken.sol, it suppose to update the index to match with LendingPool.sol contract one. updateLiquidityIndex() have onlyReservePool modifier (which let only to lending pool contract to call this function). Meanwhile LendingPool doesn't have ability to call updateLiquidityIndex().

Vulnerability Details

RToken.sol

function updateLiquidityIndex(uint256 newLiquidityIndex) external override onlyReservePool {
if (newLiquidityIndex < _liquidityIndex) revert InvalidAmount();
_liquidityIndex = newLiquidityIndex;
emit LiquidityIndexUpdated(newLiquidityIndex);
}

Within LendingPool.sol contract there is no way to call updateLiquidityIndex() from RToken, it's not implemented in any of subcall. This lead us to situation where we won't be able to update such parameter in RToken.

Impact

If protocol decide to update liquidity index - it won't be possible, essentially is dos of important setter function.

Tools Used

Manual review

Recommendations

add setter function to LendingPool.sol to ensure you could change liquidity index in RToken contract

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RToken::updateLiquidityIndex() has onlyReservePool modifier but LendingPool never calls it, causing transferFrom() to use stale liquidity index values

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.