Juicebox V2 contest - Hawkeye'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: 51/105

Findings: 2

Award: $128.44

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA

Grammatical Errors

JBTokenStore.sol

change to ‘its’:

line 122:// If the project has a current token, add it's total supply to the total.

JBSplitStore.sol

‘they are cumulatively ’

line226:// Add up all the percents to make sure they cumulative are under 100%.

spit - >split

line 284:Unpack splits' packed stored values into easy-to-work-with spit structs.

JBDirectory.sol

its - >it's

line132:// If a primary terminal for the token was specifically set and its one of the project's terminals, return it.

JBFundingCycleStore.sol

its⇒it's

line 811: // Otherwise if the ballot's duration hasn't passed, its still active.

JBSingleTokenPaymentTerminalStore.sol

Remove apostrophe from Mint's :

line 295:Mint's the project's tokens according to values provided by a configured data source. If no data source is configured, mints tokens proportional to the amount of the contribution.

“convenience”

line837:// If the fee is zero or if the fee is being used by an address that doesn't incur fees, set the discount to 100% for convinience.

Modify or remove incorrect comments

JBDirectory.sol

Within the setTerminalsOf() function, the comment that is mentioned below can be removed since the mapping is being overwritten and not deleted:

line270:// Delete the stored terminals for the project.

JBController.sol

If the condition is fulfilled, it will be reverted with “minting not allowed”. Therefore, the comment within the implementation should match but currently, it is doesn't.

line653:// If the message sender is not a terminal or a datasource, the current funding cycle must allow minting.

#0 - mejango

2022-07-13T04:39:52Z

Love this. thank you!!

Gas

Use unchecked block for gas savings

JBTokenStore.sol#L353

uint256 _unclaimedTokensToBurn = _amount - _claimedTokensToBurn;

Cannot realistically underflow since _claimedTokensToBurn will be either be less or equal to amount from the prior calculation :

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBTokenStore.sol#L350

Variables are already their default types

No need to initialise to zero :

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBProjects.sol#L40

JBSplitsStore.sol

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBSplitsStore.sol#L227

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBSplitsStore.sol#L204

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBSplitsStore.sol#L211

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBSplitsStore.sol#L229

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBSplitsStore.sol#L304

JBOperatorStore.sol

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBOperatorStore.sol#L85

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBOperatorStore.sol#L135

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBOperatorStore.sol#L165

JBFundingCycleStore.sol

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBFundingCycleStore.sol#L724

JBController.sol

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/JBController.sol#L913

JBSingleTokenPaymentTerminalStore.sol

https://github.com/jbx-protocol/juice-contracts-v2-code4rena/blob/828bf2f3e719873daa08081cfa0d0a6deaa5ace5/contracts/abstract/JBPayoutRedemptionPaymentTerminal.sol#L594

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