Renzo - twcctop's results

A protocol that abstracts all staking complexity from the end-user and enables easy collaboration with EigenLayer node operators and a Validated Services (AVSs).

General Information

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

Renzo

Findings Distribution

Researcher Performance

Rank: 78/122

Findings: 2

Award: $1.48

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2024-04-renzo/blob/549f774626b71dd13a427561d4743535a9cc0dca/contracts/RestakeManager.sol#L318

Vulnerability details

Impact

calculateTVLs will not calculate the withdraw queue value correctly, because the wrong index is used.

Proof of Concept

function calculateTVLs() public view returns (uint256[][] memory, uint256[] memory, uint256) {
...

for (uint256 i = 0; i < odLength; ) {
...
 for (uint256 j = 0; j < tokenLength; ) 
...

        if (!withdrawQueueTokenBalanceRecorded) {
        totalWithdrawalQueueValue += renzoOracle.lookupTokenValue(
 @>       collateralTokens[i],
        collateralTokens[j].balanceOf(withdrawQueue)
        );
        }

according to the code above, the wrong index is used in the collateralTokens array, i is used to stand for the operator delegator index, and j is used to stand for the token index. while collateralTokens[i] is used to get the token address, which should be collateralTokens[j] instead.

Tools Used

manual


-  collateralTokens[i],
+  collateralTokens[j],

Assessed type

Math

#0 - c4-judge

2024-05-16T10:27:00Z

alcueca marked the issue as satisfactory

#1 - c4-judge

2024-05-16T10:39:08Z

alcueca changed the severity to 3 (High Risk)

#2 - c4-judge

2024-05-20T04:26:26Z

alcueca changed the severity to 2 (Med Risk)

#3 - c4-judge

2024-05-23T13:47:20Z

alcueca changed the severity to 3 (High Risk)

Awards

1.479 USDC - $1.48

Labels

bug
2 (Med Risk)
satisfactory
sufficient quality report
:robot:_19_group
duplicate-484

External Links

Lines of code

https://github.com/code-423n4/2024-04-renzo/blob/549f774626b71dd13a427561d4743535a9cc0dca/contracts/RestakeManager.sol#L491

Vulnerability details

Impact

User is possible to get less tokens than expected when depositing to the RestakeManager contract.

Proof of Concept

function deposit in RestakeManager is to deposit collateral token to the contract and mint ezETH token to the user. The deposit function doesn't have slippage protection, so the user can get less tokens than expected.

... 
     uint256 ezETHToMint = renzoOracle.calculateMintAmount(
            totalTVL,
            collateralTokenValue,
            ezETH.totalSupply()
        );

        // Mint the ezETH
        ezETH.mint(msg.sender, ezETHToMint);

Tools Used

manual

add slippage protection to the deposit function. user should be able to set min amount of ezETH to mint when depositing to the contract.

Assessed type

Invalid Validation

#0 - c4-judge

2024-05-17T13:28:55Z

alcueca marked the issue as satisfactory

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter