Platform: Code4rena
Start Date: 30/04/2024
Pot Size: $112,500 USDC
Total HM: 22
Participants: 122
Period: 8 days
Judge: alcueca
Total Solo HM: 1
Id: 372
League: ETH
Rank: 48/122
Findings: 1
Award: $18.20
🌟 Selected for report: 0
🚀 Solo Findings: 0
18.1958 USDC - $18.20
The user will not be able to withdraw a collateral asset that he has deposited if the asset is removed. In WithdrawQueue.withdraw()
there is a check for supported tokens:
if (withdrawalBufferTarget[_assetOut] == 0) revert UnsupportedWithdrawAsset();
withdrawalBufferTarget
is synchronized with collateralTokens[]
.
After calling removeCollateralTokens
the asset is no longer supported.
The developers say that the amount of the removed asset is immediately output manually from the EigenLayer via OperatorDelegator.queueWithdrawals
to which IERC20[] calldata tokens
, uint256[] calldata tokenAmounts
are passed as parameters,but these lists do not include deleted assets, because after calling removeCollateralTokens
the assets are simply remove without consideration.
This causes the funds to get stuck
function removeCollateralToken( IERC20 _collateralTokenToRemove ) external onlyRestakeManagerAdmin { // Remove it from the list uint256 tokenLength = collateralTokens.length; for (uint256 i = 0; i < tokenLength; ) { if (address(collateralTokens[i]) == address(_collateralTokenToRemove)) { collateralTokens[i] = collateralTokens[collateralTokens.length - 1]; collateralTokens.pop(); emit CollateralTokenRemoved(_collateralTokenToRemove); return; } unchecked { ++i; } }
Manual
create 'blacklist' type arrays into which you can loop through and withdraw the remaining asset funds
Other
#0 - c4-judge
2024-05-17T14:03:51Z
alcueca changed the severity to 3 (High Risk)
#1 - c4-judge
2024-05-17T14:05:47Z
alcueca marked the issue as unsatisfactory: Invalid
#2 - c4-judge
2024-05-20T04:34:14Z
alcueca changed the severity to 2 (Med Risk)
#3 - c4-judge
2024-05-20T04:41:25Z
alcueca marked the issue as satisfactory
18.1958 USDC - $18.20
the amount to be returned to the user will be incorrect because of the incorrect totalTVL value that calculateTVLs returns.This happens when the funds of remove assets get stuck in the protocol (although the developers claim that the admin manually removes the sums of deleted assets, but this is not the case).
In case when a user deposited an asset and it was remove from the supported tokens, the result is that the amount gets stuck and is not taken into account in calculateTVLs
.
calculateTVLs
is calculated only on collateralTokens [] (supported tokens), it returns the value of totalTVL which is used to calculate amountRedeem
as a result the user gets an incorrect amount.
uint256 amountToRedeem = renzoOracle.calculateRedeemAmount( _amount, ezETH.totalSupply(), totalTVL //! wrong );
manual
Context
#0 - CloudEllie
2024-05-10T17:40:20Z
Adjusting duplicate grouping per validator @0xJuancito's recommendation
#1 - c4-judge
2024-05-17T13:56:56Z
alcueca marked the issue as not a duplicate
#2 - c4-judge
2024-05-17T13:57:04Z
alcueca marked the issue as duplicate of #464
#3 - c4-judge
2024-05-17T14:03:49Z
alcueca changed the severity to 3 (High Risk)
#4 - c4-judge
2024-05-17T14:04:09Z
alcueca marked the issue as duplicate of #97
#5 - c4-judge
2024-05-17T14:05:45Z
alcueca marked the issue as unsatisfactory: Invalid
#6 - c4-judge
2024-05-20T04:34:15Z
alcueca changed the severity to 2 (Med Risk)
#7 - c4-judge
2024-05-20T04:41:18Z
alcueca marked the issue as satisfactory