Juicebox V2 contest - Aymen0909'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: 91/105

Findings: 1

Award: $38.24

🌟 Selected for report: 0

🚀 Solo Findings: 0

[G-1]- <ARRAY>.LENGTH SHOULD NOT BE LOOKED UP IN EVERY LOOP OF A FOR-LOOP :

The array length used inside a loop for incrementing i must not be looked up in every iteration

File: juice-contracts-v2-code4rena/contracts/JBDirectory.sol

line 167 : for (uint256 _i; _i < _terminalsOf[_projectId].length; _i++)

[G-2]- <X> += <Y> COSTS MORE GAS THAN <X> = <X> + <Y> FOR STATE VARIABLES :

File: juice-contracts-v2-code4rena/contracts/JBTokenStore.sol

line 409 : unclaimedBalanceOf[_holder][_projectId] = unclaimedBalanceOf[_holder][_projectId] - _amount; line 412 : unclaimedTotalSupplyOf[_projectId] = unclaimedTotalSupplyOf[_projectId] - _amount; line 451 : unclaimedBalanceOf[_recipient][_projectId] = unclaimedBalanceOf[_recipient][_projectId] + _amount;

[G-3]- READING MEMORY VARIABLE INSTEAD OF STATE VARIABLE INSIDE A FOR LOOP :

File: juice-contracts-v2-code4rena/contracts/JBDirectory.sol

line 168 : if (_terminalsOf[_projectId][_i] == _terminal) return true;

[G-4]- USE OF ++i COST LESS GAS THAN i++ IN FOR LOOPS :

File: juice-contracts-v2-code4rena/contracts/JBDirectory.sol

line 167 : for (uint256 _i; _i < _terminalsOf[_projectId].length; _i++)

File: juice-contracts-v2-code4rena/contracts/JBOperatorStore.sol

line 85 : for (uint256 _i = 0; _i < _permissionIndexes.length; _i++);

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