Ethena Labs - adam-idarrha's results

Enabling The Internet Bond

General Information

Platform: Code4rena

Start Date: 24/10/2023

Pot Size: $36,500 USDC

Total HM: 4

Participants: 147

Period: 6 days

Judge: 0xDjango

Id: 299

League: ETH

Ethena Labs

Findings Distribution

Researcher Performance

Rank: 108/147

Findings: 1

Award: $4.52

QA:
grade-b

🌟 Selected for report: 0

šŸš€ Solo Findings: 0

Summary<a name="Summary">

Non Critical Issues

Issuenumber of Instances
N‑01remove useless variable and line in function transferInRewards1
N‑02remove useless check in function _transferCollateral1

Non Critical Issues:

<a href="#Summary">[N‑01]</a><a name="N&#x2011;01"> remove useless variable and line in function transferInRewards

the function transferInRewards is used by the REWARDER_ROLE to give rewards to usde stackers, it will only work if getUnvestedAmount is 0, revert otherwise. it assigns the value that the REWARDER_ROLE is vesting , by adding the amount of usde tokens vested plus getUnvestedAmount which is always 0. that's why we can eliminate a memory varaiable and a line to simplify and optimize code to be like this vestingAmount = amount;

  • StakedUSDe.sol ( #L90):
if (getUnvestedAmount() > 0) revert StillVesting();
    uint256 newVestingAmount = amount + getUnvestedAmount();

    vestingAmount = newVestingAmount;

<a href="#Summary">[N‑02]</a><a name="N&#x2011;02"> remove useless check in function _transferCollateral

in the function _transferCollateral we transfer the collateral given by the user to the various custodians based on ratios, we already check that the sum of the ratios given to the function is 10_000, so there will be no remaining balance after transfering. but in the function we check if there is some remaining amount, which will never be the case. should delete the last two lines in the function as they are a branch that will never be visited.

  • EthenaMinting.sol ( #L430):
if (remainingBalance > 0) {
      token.safeTransferFrom(benefactor, addresses[addresses.length - 1], remainingBalance);
    }
  • EthenaMinting.sol ( #L370):
if (totalRatio != 10_000) {
      return false;
    }

#0 - c4-pre-sort

2023-11-02T01:12:18Z

raymondfam marked the issue as low quality report

#1 - raymondfam

2023-11-02T01:15:28Z

N-02 is a false positive.

#2 - c4-judge

2023-11-14T17:13:04Z

fatherGoose1 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