Core Contracts

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

Deposits to the Curve vault will fail

Summary

All vault deposits fail due to misalignment between token holder (RToken contract) and the contract attempting to deposit (LendingPool).

Vulnerability Details

The deposit function in the LendingPool contract allows users to deposit reserve assets (crvUSD) and receive RTokens. The process follows these steps:

  1. crvUSD is transferred from the user to the RToken contract, which then mints RTokens to the user (using ReserveLibrary)

  2. The deposit function calls _rebalanceLiquidity. If currentBuffer exceeds desiredBuffer, _depositIntoVault is invoked

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

The issue occurs because:

  1. All crvUSD tokens are held by the RToken contract

  2. The Curve vault's deposit function attempts to transfer crvUSD from the msg.sender (LendingPool)

  3. Even though LendingPool approves the vault, the transfer will fail as LendingPool does not have the tokens

Impact

High: All vault deposits will fail, breaking core protocol functionality.

Recommendations

Fix the token flow to ensure the correct contract holds and transfers the assets.

Current flow (failing):
RToken (has tokens) -> Curve vault tries to take from LendingPool (no tokens)

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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 7 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.

Give us feedback!