PartyDAO contest - B2's results

A protocol for buying, using, and selling NFTs as a group.

General Information

Platform: Code4rena

Start Date: 12/09/2022

Pot Size: $75,000 USDC

Total HM: 19

Participants: 110

Period: 7 days

Judge: HardlyDifficult

Total Solo HM: 9

Id: 160

League: ETH

PartyDAO

Findings Distribution

Researcher Performance

Rank: 59/110

Findings: 2

Award: $117.69

🌟 Selected for report: 0

🚀 Solo Findings: 0

Public function that could be declared external

Missing zero address validation

Unlocked Pragma

MULTIPLE UINT256 MAPPINGS CAN BE COMBINED INTO A SINGLE MAPPING OF AN UNIT256 TO A STRUCT, WHERE APPROPRIATE

Dependence on block.timestamp is risky as it can be manipulated by miners

APPROVE should be replaced with SAFEAPPROVE or SAFEINCREASEALLOWANCE()/SAFEDECREASEALLOWANCE()

approve is subject to a known front-runnning attack. Consider using safeApprove instead. Instances are below:

Multiple return statements used

#0 - 0xble

2022-09-26T01:37:06Z

Unhelpful bot report

#1 - HardlyDifficult

2022-10-03T22:41:27Z

AN ARRAY’S LENGTH SHOULD BE CACHED TO SAVE GAS IN FOR-LOOPS

Reading array length at each iteration of the loop consumes .more gas than necessary.Consider storing the array’s length in a variable before the for-loop. Below are the instances :

OPTIMISE IF STATEMENT

For uint, >0 is not required. Instead use the variable directly as shown below. In line https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/Crowdfund.sol#L144, change to if (initialBalance) { Same in https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/Crowdfund.sol#L471

++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR AND WHILE LOOPS

NO NEED TO EXPLICITLY INITIALIZE VARIABLES WITH DEFAULT VALUES

If a variable is not set/initialized, it is assumed to have the default value (0 for uint, false for bool, address(0) for address…). Explicitly initializing it with its default value is an anti-pattern and wastes gas.

#0 - 0xble

2022-09-26T01:36:25Z

Unhelpful bot report

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