Renzo - siguint'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: 103/122

Findings: 1

Award: $0.00

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

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

Vulnerability details

In the calculateTVLs() function there is a loop which iterates over operator delegators and an inner loop which iterates over collateral tokens for every operator delegator. For the first operator delegator, withdrawQueueTokenBalanceRecorded is set to false, so we pass through if statement with i = 0.

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

For the first collateral token, j == 0, but if we have more than one token, totalWithdrawalQueueValue will be incorrect. We will add amount_j * price_i instead of amount_j * price_j.

Impact

Incorrect totalTVL calculation.

Tools Used

Manual Review

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

Assessed type

Loop

#0 - c4-judge

2024-05-16T10:38:01Z

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:21Z

alcueca changed the severity to 3 (High Risk)

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