Core Contracts

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

_withdrawFromVault funds should go to RToken contract

Summary

In _rebalanceLiquidity it checks desiredBuffer and currentBuffer if currentBuffer < desiredBuffer , then it withdraw funds from curve vault. The issue is that it withdrew funds and sent it to the lendingPool instead of the Rtoken contract.

Vulnerability Details

function _withdrawFromVault(uint256 amount) internal {
curveVault.withdraw(amount, address(this), msg.sender, 0, new address[](0));
totalVaultDeposits -= amount;
}

Here receiver address is set to address(this) which is the LendingPool , but instead , it should be Rtoken contract. Since its needed to fullfill the shortage on Rtoken contract with this rebalancing.

Impact

Rebalancing liquidity is not performed as expected.

Tools Used

Manual Review

Recommendations

Set receiver address as reserve.reserveRTokenAddress contract. Also need to burn position from the Lending pool instead of caller

function _withdrawFromVault(uint256 amount) internal {
// @auditFix : Withdraw assets from the Curve Vault and send them to the RToken contract
curveVault.withdraw(amount, reserve.reserveRTokenAddress, address(this), 0, new address[](0));
totalVaultDeposits -= amount;
}

Updates

Lead Judging Commences

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