Frax Ether Liquid Staking contest - millersplanet's results

A liquid ETH staking derivative designed to uniquely leverage the Frax Finance ecosystem.

General Information

Platform: Code4rena

Start Date: 22/09/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 133

Period: 3 days

Judge: 0xean

Total Solo HM: 2

Id: 165

League: ETH

Frax Finance

Findings Distribution

Researcher Performance

Rank: 80/133

Findings: 2

Award: $40.82

🌟 Selected for report: 0

🚀 Solo Findings: 0

Info

  • The function beforeWithdraw() on sfrxETH contract (line 48) is internal but is never called inside the contract. Besides, it's not seen that sfrxETH.sol is inherited in any other contract on the protocol, which makes the function a piece of "dead code".

    RECOMMENDATION: Consider changing its visibilty or make sure that is called/implemented correctly inside the protocol.

ERC20PermitPermissionedMint.sol

  • The onlyByOwnGov() modifier has a require statement that can be refactored with an if statement and a custom error. (Line 41)

    Declare error:

    error NotOwnerOrTimelock();

    and replace the mentioned line with the following:

    if (msg.sender != timelock_address || msg.sender != owner) revert NotOwnerOrTimelock();
  • The onlyMinters() modifier has a require statement that can be refactored with an if statement and a custom error. (Line 46)

    Declare error:

    error OnlyMinters();

    and replace the mentioned line with the following:

    if (!minters[msg.sender]) revert OnlyMinters();
  • The addMinter() function has two require statements that can be refactored with an if statement and a custom error. (Lines 66, 68)

    Declare errors:

    error ZeroAddressDetected(); error AddressAlreadyExists();

    and replace the mentioned lines with the following:

    if (minter_address == address(0)) revert ZeroAddressDetected(); if (minters[minter_address]) revert AddressAlreadyExists();
  • The removeMinter() function has two require statements that can be refactored with an if statement and a custom error. (Lines 77, 78)

    Declare error:

    error AddressNonExistant();

    and replace the mentioned lines with the following:

    if (minter_address == address(0)) revert ZeroAddressDetected(); if (!minters[minter_address]) revert AddressNonExistant();
  • The setTimelock() function has a require statement that can be refactored with an if statement and a custom error. (Line 95):

    Replace the mentioned line with the following:

    if (_timelock_address == address(0)) revert ZeroAddressDetected();

    Note that ZeroAddressDetected(); is declared only once and is used three times without being re-declared with this access control implementation.

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