Juicebox contest - minhtrng's results

The decentralized fundraising and treasury protocol.

General Information

Platform: Code4rena

Start Date: 18/10/2022

Pot Size: $50,000 USDC

Total HM: 13

Participants: 67

Period: 5 days

Judge: Picodes

Total Solo HM: 7

Id: 172

League: ETH

Juicebox

Findings Distribution

Researcher Performance

Rank: 50/67

Findings: 1

Award: $37.88

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

use of child contract were base contract would be more appropriate

In JBTiered721DelegateDeployer.sol L. 83-84 the initialize function is called on a contract instance which can be of type JB721GlobalGovernance, JB721TieredGovernance or JB721TieredDelegate:

JB721GlobalGovernance newDelegate = JB721GlobalGovernance(_clone(codeToCopy));
newDelegate.initialize(
    ...

Even though this works fine, due to the way inter-contract calls work in the EVM (would break in other statically typed languages), for clarity of code this should be casted to the common base contract which defines the initialize function, namely JB721TieredDelegate:

JB721TieredDelegate newDelegate = JB721TieredDelegate(_clone(codeToCopy));
newDelegate.initialize(
    ...

unbounded loop which could affect GlobalGovernance

The function JBTiered721DelegateStore.votingUnitsOf iterates over all tiers defined on a given NFT-contract. Hypothetically this could cause calls of the function to run out of gas for a large amount of tiers and break JB721GlobalGovernance._getVotingUnits which is again used by Votes._delegate. In practice this seems unlikely to happen, as the function does not perform heavy calculations and would require a very large number of tiers for this to happen.

#0 - c4-judge

2022-11-08T18:18:12Z

Picodes marked the issue as grade-b

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