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: 91/122
Findings: 3
Award: $0.04
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: pauliax
Also found by: 0rpse, 0x73696d616f, 0xAadi, 0xCiphky, 0xPwned, 0xhacksmithh, 0xnev, 0xnightfall, 0xordersol, 14si2o_Flint, Aamir, Aymen0909, BiasedMerc, DanielArmstrong, Fassi_Security, FastChecker, GoatedAudits, Greed, KupiaSec, LessDupes, Maroutis, NentoR, OMEN, SBSecurity, Stefanov, TheFabled, adam-idarrha, ak1, aman, araj, aslanbek, b0g0, baz1ka, bigtone, blutorque, carlitox477, carrotsmuggler, crypticdefense, eeshenggoh, fyamf, gesha17, gjaldon, grearlake, guhu95, honey-k12, hunter_w3b, ilchovski, josephdara, kinda_very_good, lanrebayode77, m_Rassska, maxim371, mt030d, mussucal, oakcobalt, p0wd3r, peanuts, rbserver, shui, siguint, t0x1c, tapir, twcctop, ustazz, xg, zhaojohnson, zigtur, zzykxx
0.0026 USDC - $0.00
The pricing of ezeth will always be wrong
if (!withdrawQueueTokenBalanceRecorded) { totalWithdrawalQueueValue += renzoOracle.lookupTokenValue( collateralTokens[i], collateralTokens[j].balanceOf(withdrawQueue) );} withdrawQueueTokenBalanceRecorded = true;
The total tvl is meant to be an addition of the tvl locked in eigen layer + the eth value in depositqueue and the eth and erc20 balances of withdrawqueue. However the above logic gets the first token and check its value using the balances of the other tokens in the withdrawqueue, instead of getting the value of the individual token balances in the withdrawqueue
manual analysis
on line 318 the collateralTokens[i] should be instead be collateral[j] to loop through every token and their balance
Other
#0 - c4-judge
2024-05-16T10:37:13Z
alcueca marked the issue as satisfactory
#1 - c4-judge
2024-05-16T10:38:47Z
alcueca changed the severity to 2 (Med Risk)
#2 - c4-judge
2024-05-16T10:39:08Z
alcueca changed the severity to 3 (High Risk)
#3 - c4-judge
2024-05-20T04:26:26Z
alcueca changed the severity to 2 (Med Risk)
#4 - c4-judge
2024-05-23T13:47:20Z
alcueca changed the severity to 3 (High Risk)
🌟 Selected for report: 0xCiphky
Also found by: 0rpse, 0x007, 0xAadi, 14si2o_Flint, ADM, Aamir, Aymen0909, BiasedMerc, DanielArmstrong, Fassi_Security, FastChecker, KupiaSec, LessDupes, MaslarovK, Neon2835, RamenPeople, SBSecurity, Shaheen, Tendency, ZanyBonzy, adam-idarrha, araj, b0g0, baz1ka, bigtone, bill, blutorque, carrotsmuggler, cu5t0mpeo, fyamf, gesha17, gumgumzum, hunter_w3b, inzinko, jokr, josephdara, kennedy1030, kinda_very_good, lanrebayode77, m_Rassska, mt030d, mussucal, tapir, underdog, xg, zzykxx
0.0402 USDC - $0.04
Judge has assessed an item in Issue #517 as 2 risk. The relevant finding follows:
[L1] if a user deposits less than the current withdrawbuffer, the call will revert
#0 - c4-judge
2024-05-24T09:26:22Z
alcueca marked the issue as duplicate of #198
#1 - c4-judge
2024-05-24T09:26:26Z
alcueca marked the issue as satisfactory
🌟 Selected for report: Sathish9098
Also found by: 0x73696d616f, 0xCiphky, 0xmystery, ABAIKUNANBAEV, Bauchibred, BiasedMerc, Fassi_Security, FastChecker, GalloDaSballo, GoatedAudits, K42, KupiaSec, LessDupes, Limbooo, ReadyPlayer2, Rhaydden, SBSecurity, Sabit, Sparrow, WildSniper, ZanyBonzy, adam-idarrha, adeolu, araj, aslanbek, atoko, b0g0, carlitox477, crypticdefense, fyamf, gesha17, gjaldon, grearlake, gumgumzum, hihen, honey-k12, hunter_w3b, inzinko, jesjupyter, jokr, kennedy1030, kind0dev, kinda_very_good, ladboy233, lanrebayode77, oakcobalt, oualidpro, pauliax, rbserver, t0x1c, tapir, underdog, xg, zzykxx
0 USDC - $0.00
[L1] if a user deposits less than the current withdrawbuffer, the call will revert
uint256 bufferToFill = depositQueue.withdrawQueue().getBufferDeficit( address(_collateralToken) ); if (bufferToFill > 0) { bufferToFill = (_amount <= bufferToFill) ? _amount : bufferToFill; // update amount to send to the operator Delegator _amount -= bufferToFill; // safe Approve for depositQueue _collateralToken.safeApprove(address(depositQueue), bufferToFill); // fill Withdraw Buffer via depositQueue depositQueue.fillERC20withdrawBuffer(address(_collateralToken), bufferToFill); } // Approve the tokens to the operator delegator _collateralToken.safeApprove(address(operatorDelegator), _amount); // Call deposit on the operator delegator operatorDelegator.deposit(_collateralToken, _amount);
this sets the amount to zero if less than or equal the buffer to zero
function deposit( IERC20 token, uint256 tokenAmount ) external nonReentrant onlyRestakeManager returns (uint256 shares) { if (address(tokenStrategyMapping[token]) == address(0x0) || tokenAmount == 0) revert InvalidZeroInput();
this will cause a revert as the amount is already set to zero
[L2] Removing an operator delegator on RestakeManager does not reset its allocation or basis points
uint256 odLength = operatorDelegators.length; for (uint256 i = 0; i < odLength; ) { if (address(operatorDelegators[i]) == address(_operatorDelegatorToRemove)) { // Clear the allocation operatorDelegatorAllocations[_operatorDelegatorToRemove] = 0; emit OperatorDelegatorAllocationUpdated(_operatorDelegatorToRemove, 0); // Remove from list operatorDelegators[i] = operatorDelegators[operatorDelegators.length - 1]; operatorDelegators.pop(); emit OperatorDelegatorRemoved(_operatorDelegatorToRemove); return; } unchecked { ++i; } } // If the item was not found, throw an error revert NotFound();
only the operator delegator itself is removed
[L3] a delegator can end up holding more than the allocation it is meant to be holding
if (operatorDelegators.length == 0) revert NotFound(); // If there is only one operator delegator, return it if (operatorDelegators.length == 1) { return operatorDelegators[0]; } // Otherwise, find the operator delegator with TVL below the threshold uint256 tvlLength = tvls.length; for (uint256 i = 0; i < tvlLength; ) { if ( tvls[i] < (operatorDelegatorAllocations[operatorDelegators[i]] * totalTVL) / BASIS_POINTS / BASIS_POINTS ) { return operatorDelegators[i]; } unchecked { ++i; } } // Default to the first operator delegator return operatorDelegators[0];
when computing it doesnt account for the new increase in tvl and delegator tvl meaning a delegator meant to handle only 5 % but is at 4.9% could push up to 7 ot 8 % will a new deposit
[L4] There might be disparities between l1 and l2 timestamps when sending feeds to l2
[L5] OptimismMintableXERC20 should be initialized in the same call it is deployed to avoid frontrun
In OptimismMintableXERC20Factory::deployOptimismMintableXERC20, the contract is deployed but not initialized which cause lead to an initialization frontrun
#0 - CloudEllie
2024-05-13T14:07:35Z
#1 - c4-judge
2024-05-24T09:27:19Z
alcueca marked the issue as grade-b