Juicebox Buyback Delegate - pxng0lin's results

Thousands of projects use Juicebox to fund, operate, and scale their ideas & communities transparently on Ethereum.

General Information

Platform: Code4rena

Start Date: 18/05/2023

Pot Size: $24,500 USDC

Total HM: 3

Participants: 72

Period: 4 days

Judge: LSDan

Id: 237

League: ETH

Juicebox

Findings Distribution

Researcher Performance

Rank: 59/72

Findings: 1

Award: $16.19

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Issues

Immutable address arguments provided to the constructor are missing zero address checks this could result in unexpected behavior when attempting to use the contract.

Link to code

File: juice-buyback/contracts/JBXBuybackDelegate.sol

124: projectToken = _projectToken; 125: pool = _pool; 126: jbxTerminal = _jbxTerminal; 127: ... 128: weth = _weth;

Recommendation

Implement a zero address check using the require function and the != (inequality) operator with address(0).

Example:

// zero address check immutable contracts. require(_projectToken != address(0), "Invalid project token address"); require(_pool != address(0), "Invalid pool address"); require(_jbxTerminal != address(0), "Invalid terminal address"); require(_weth != address(0), "Invalid weth address"); // assign after successful zero address checks. projectToken = _projectToken; pool = _pool; jbxTerminal = _jbxTerminal; _projectTokenIsZero = address(_projectToken) < address(_weth); // no change as used for bool true/false weth = _weth;

#0 - c4-judge

2023-06-02T10:57:21Z

dmvt 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