Core Contracts

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

Incorrect Liquidity Source in _depositIntoVault() Function

Summary

The _rebalanceLiquidity() function is responsible for maintaining an optimal liquidity buffer ratio by moving excess crvUSD into the Curve vault or withdrawing funds when there’s a shortage. However, the _depositIntoVault() function incorrectly attempts to deposit crvUSD from the LendingPool.sol contract, while all crvUSD deposits are stored in RToken.sol.

This results in a failed deposit operation because the CurveVault tries to pull crvUSD from LendingPool.sol, where no crvUSD tokens exist.

Vulnerability Details

Liquidity deposits (crvUSD) go directly into the RToken contract.
_rebalanceLiquidity() calculates how much crvUSD should remain available based on liquidityBufferRatio.
If there is excess liquidity, _depositIntoVault(excess) is called.
_depositIntoVault(amount) then approves the Curve vault to pull crvUS and calls deposit() on the vault:

IERC20(reserve.reserveAssetAddress).approve(address(curveVault), amount);
curveVault.deposit(amount, address(this));

The Curve vault tries to pull crvUSD from LendingPool.sol, but the funds are actually held in RToken.sol. The deposit transaction fails due to insufficient balance.

Incorrect Behavior Flow

  1. Users deposit crvUSD → Funds go into RToken.sol.

  2. Protocol detects excess liquidity → Calls _depositIntoVault(excess).

  3. Curve vault tries to pull crvUSD from LendingPool.solFails because crvUSD is in RToken.sol.

Impact

Failed Deposits and protocol Halt: _depositIntoVault() fails whenever _rebalanceLiquidity() tries to transfer excess liquidity which causes the transaction to revert and makes the protocol unusable.

Note: _depositIntoVault() will be called on the very first deposit transaction.

Tools Used

manual review

Recommendations

Implement the function _depositIntoVault() in the RToken.sol contract with a modifier onlyLendingPool and call it from the LendingPool.sol.

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.