Stader Labs - bigtone's results

Decentralized ETH liquid staking protocol with 4 ETH bond for anyone to be a node operator.

General Information

Platform: Code4rena

Start Date: 02/06/2023

Pot Size: $100,000 USDC

Total HM: 15

Participants: 75

Period: 7 days

Judge: Picodes

Total Solo HM: 5

Id: 249

League: ETH

Stader Labs

Findings Distribution

Researcher Performance

Rank: 59/75

Findings: 1

Award: $21.62

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

21.6219 USDC - $21.62

Labels

bug
G (Gas Optimization)
grade-b
G-01

External Links

Report

Summary

IssueInstances
GAS-1To optimize gas usage, invoke this external function once2
GAS-2It doesn't need to calculate the bids amount.1

Issues

Gas Optimizations

IssueInstances
GAS-1To optimize gas usage, invoke this external function once2
GAS-2It doesn't need to calculate the bids amount.1

<a name="GAS-1"></a>[GAS-1] To optimize gas usage, invoke this external function once

Impact:

To optimize gas usage, invoke this external function once staderConfig.getStakePoolManager(), staderConfig.getStaderTreasury()

Vulnerability Detail
File: contracts/Auction.sol:L102-L103
    IStaderStakePoolManager(staderConfig.getStakePoolManager()).receiveEthFromAuction{value: ethAmount}();
    emit ETHClaimed(lotId, staderConfig.getStakePoolManager(), ethAmount);

File: contracts/Auction.sol:L114-L117
    if (!IERC20(staderConfig.getStaderToken()).transfer(staderConfig.getStaderTreasury(), _sdAmount)) {
        revert SDTransferFailed();
    }
    emit UnsuccessfulSDAuctionExtracted(lotId, _sdAmount, staderConfig.getStaderTreasury());
Recommendation

Recommend that declare the local variable to save address and use it.

<a name="GAS-2"></a>[GAS-2] It doesn't need to calculate the bids amount.

Impact:

It doesn't need to calculate the bids amount.

Vulnerability Detail
File: contracts/Auction.sol:L128
    lotItem.bids[msg.sender] -= withdrawalAmount; 

File: contracts/Auction.sol:L128
    lotItem.bids[msg.sender] = 0; 
Recommendation

Recommend to directly set it to 0.

#0 - c4-judge

2023-06-13T21:36:08Z

Picodes 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