Closed c4-submissions closed 11 months ago
raymondfam marked the issue as insufficient quality report
The initial asset deposit is transferred to the contract prior to minting:
if (!IERC20(asset).transferFrom(msg.sender, address(this), depositAmount)) {
revert TokenTransferFailed();
}
raymondfam marked the issue as primary issue
fatherGoose1 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L119
Vulnerability details
Impact
The
LRTDepositPool#depositAsset()
function is employed for users to deposit supported assets. This function relies onLRTDepositPool#getTotalAssetDeposits()
to determine the amount ofrsETH
to be minted. However, the absence of initial deposits in the protocol—whether in the deposit pool, Node Delegator, or in assets staked in EigenLayer—results inLRTDepositPool#getTotalAssetDeposits()
always being 0. This vulnerability prevents the protocol from successfully receiving deposits from users.The getTotalAssetDeposits() function does always return 0 due to the absence of initial deposits, it could prevent the protocol from successfully receiving deposits from users.
The amount of rsETH to be minted is calculated based on the total asset deposits, and this total is initially 0, then no rsETH would be minted when users deposit assets. This could effectively prevent the protocol from receiving deposits, as users would not receive any tokens in return for their deposits.
Proof of Concept
getAssetDistributionData()
to calculate the amount, but initially there will not be any deposited amount, and this will return 0Finally, 109 line
rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();
ingetRsETHAmountToMint()
throw division by zero error. This error will prevent users from depositing assets.Tools Used
Manual Review
Recommended Mitigation Steps
To address the issue, consider adding assets into the deposit pool or delegator contract as an initial supply. This will enable the protocol to start receiving deposits from users successfully.
Assessed type
Token-Transfer