LSD Network - Stakehouse contest - 0xmuxyz's results

A permissionless 3 pool liquid staking solution for Ethereum.

General Information

Platform: Code4rena

Start Date: 11/11/2022

Pot Size: $90,500 USDC

Total HM: 52

Participants: 92

Period: 7 days

Judge: LSDan

Total Solo HM: 20

Id: 182

League: ETH

Stakehouse Protocol

Findings Distribution

Researcher Performance

Rank: 76/92

Findings: 1

Award: $52.03

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Report title

  • Should use custom error statement instead of using revert("<Error message written by string type>") statement

Code Snippet that has not been optimized yet

Description

  • Custom error statement that consists of both error() statement and revert() statement has been able to use since solidity version 0.8.4

Recommendation

For example,

contract LiquidStakingManager is ILiquidStakingManager, Initializable, ReentrancyGuard, StakehouseAPI {

    //@dev - Define a custom error
    error UnexpectedState();

    〜〜Omission〜〜

    function _authorizeRepresentative(
        address _smartWallet, 
        address _eoaRepresentative, 
        bool _isEnabled
    ) internal {
        if(!_isEnabled && smartWalletRepresentative[_smartWallet] != address(0)) {

            〜〜Omission〜〜

            emit RepresentativeAppointed(_smartWallet, _eoaRepresentative);
        } else {
            //@dev - Apply custom error
            revert UnexpectedState();
        }
    }

#0 - c4-judge

2022-12-01T23:52:36Z

dmvt marked the issue as grade-b

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