Juicebox V2 contest - asutorufos's results

The decentralized fundraising and treasury protocol.

General Information

Platform: Code4rena

Start Date: 01/07/2022

Pot Size: $75,000 USDC

Total HM: 17

Participants: 105

Period: 7 days

Judge: Jack the Pug

Total Solo HM: 5

Id: 143

League: ETH

Juicebox

Findings Distribution

Researcher Performance

Rank: 50/105

Findings: 2

Award: $128.44

🌟 Selected for report: 0

🚀 Solo Findings: 0

L-1 MISSING CHECKS FOR APPROVE() Sometimes some tokens will return false rather then reverting so it better practice to use OpenZeppelin's safeApprove() which will revert if there is a failure. JBERC20PaymentTerminal.sol L#99

L-2 Use Two-Step Transfer Pattern for Access Controls Contracts implementing access control's, e.g. owner, should consider implementing a Two-Step Transfer pattern.

Otherwise it's possible that the role mistakenly transfers ownership to the wrong address, resulting in a loss of the role. [JBTokenStore.sol]https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBTokenStore.sol#:~:text=if%20(_newOwner%20!%3D,(_projectId%2C%20_newOwner)%3B

N-1 NATSPEC IS INCOMPLETE

  @param _interfaceId The ID of the interface to check for adherance to.
  */
  function supportsInterface(bytes4 _interfaceId)
    public
    view
    virtual
    override(IERC165, ERC721)
    returns (bool)

Missing: @return

G-1 CACHING STORAGE VARIABLES IN MEMORY TO SAVE GAS In particular, in for loops, when using the length of a storage array as the condition being checked after each loop, caching the array length in memory can yield significant gas savings if the array length is high. JBOperatorStore.sol L#135 JBOperatorStore.sol L#165

G-2 PREFIX INCREMENTS Prefix increments are cheaper than postfix increments.

JBFundingCycleStore.sol

JBFundingCycleStore.sol:724

JBSplitStore.sol

JBSplitStore.sol:204
JBSplitStore.sol:211
JBSplitStore.sol:229
JBSplitStore.sol:304

JBOperatorStore.sol

JBOperatorStore.sol:85
JBOperatorStore.sol:135
JBOperatorStore.sol:165

JBDirectory.sol

JBDirectory.sol:139
JBDirectory.sol:167
JBDirectory.sol:275
JBDirectory.sol:276

G-3 Don't Initialize Variables with Default Value Uninitialized variables are assigned with the types default value.

JBFundingCycleStore.sol

JBFundingCycleStore.sol:724

JBSplitStore.sol

JBSplitStore.sol:204
JBSplitStore.sol:211
JBSplitStore.sol:229
JBSplitStore.sol:304

JBOperatorStore.sol

JBOperatorStore.sol:85
JBOperatorStore.sol:135
JBOperatorStore.sol:165

JBDirectory.sol

JBDirectory.sol:139
JBDirectory.sol:167
JBDirectory.sol:275
JBDirectory.sol:276
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