Core Contracts

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

Deposit Assets from `LendingPool` to Curve Vault Will Fail

Summary

The LendingPool.deposit() function transfers reserve assets from the user to the RToken contract. However, during liquidity rebalancing, the _depositIntoVault() function attempts to transfer assets from the LendingPool contract to the curveVault. Since the assets are held in the RToken contract and not the LendingPool, this results in a transaction failure due to insufficient balance.

Vulnerability Details

The _depositIntoVault() function assumes that the reserve assets are held in the LendingPool contract. However, the assets are actually transferred to the Rtoken contract during the deposit() process. As a result, the LendingPool contract does not have the required balance to execute the transfer, causing the transaction to fail.

LendingPool::_depositIntoVault()

function _depositIntoVault(uint256 amount) internal {
IERC20(reserve.reserveAssetAddress).approve(address(curveVault), amount);
curveVault.deposit(amount, address(this));
totalVaultDeposits += amount;
}

Impact

Liquidity rebalancing will fail, preventing assets from being deposited into the curveVault.

Tools Used

vscode

Recommendations

Modify the _depositIntoVault() function to transfer assets from the Rtoken contract (where the assets are actually held) instead of the LendingPool contract.

Updates

Lead Judging Commences

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

LendingPool::_depositIntoVault and _withdrawFromVault don't transfer tokens between RToken and LendingPool, breaking Curve vault interactions

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

LendingPool::_depositIntoVault and _withdrawFromVault don't transfer tokens between RToken and LendingPool, breaking Curve vault interactions

Support

FAQs

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