Frax Ether Liquid Staking contest - cryptphi'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: 66/133

Findings: 2

Award: $40.88

🌟 Selected for report: 0

🚀 Solo Findings: 0

  1. Missing zero value check would cause a divide by zero error revertWhen sfrxETH contract is deployed, it also deploys the xERC4626 contract. However, there is a missing zero value check in both contracts, which may cause a divide by zero error revert.

  2. Missing zero address check Occurrences

  • ERC20PermitPermissionedMint.constructor() is missing a zero address check for the _timelock_address argument.
  • OperatorRegistry.constructor() is missing a zero address check for the _timelock_address argument.
  • frxETHMinter.constructor() is missing a zero address check for the _timelock_address, depositContractAddress, frxETHAddress, sfrxETHAddress  arguments.
  1. Setting minters_array index to 0x0 address may cause revert in a future feature

https://github.com/code-423n4/2022-09-frax/blob/main/src/ERC20/ERC20PermitPermissionedMint.sol#L84-L88

This block of code attempts to set the minters_array index to null after deleting the minter address in that index. Peradventure the state variable is used in a different feature in the future, it may cause reverts or have an input for the feature's function to be address(0). It is better to use a different method that will use a pop() .

  1. Missing zero value check OperatorRegistry.constructor() is missing a zero value check for _withdrawal_pubkey argument

  2. No check for same validators index input in OperatorRegistry.swapValidator() There is no check in OperatorRegistry.swapValidator() to ensure the from_idx and to_idx are not the same.

  1. add clearValidatorArray() before the require statement in setWithdrawalCredential() to ensure validators array is cleared. To save more gas, clearValidatorArray() can be made internal and included in setWithdrawalCredential() and then a separate external function that calls the internal clearValidatorArray() is added to the contract , to make things all tidy and proper.
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