Nouns DAO contest - shark's results

A DAO-driven NFT project on Ethereum.

General Information

Platform: Code4rena

Start Date: 22/08/2022

Pot Size: $50,000 USDC

Total HM: 4

Participants: 160

Period: 5 days

Judge: gzeon

Total Solo HM: 2

Id: 155

League: ETH

Nouns DAO

Findings Distribution

Researcher Performance

Rank: 156/160

Findings: 1

Award: $16.66

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. i++ costs more gas than ++i

++i costs 5 gas less than i++, this is because i++ creates a temporary variable while ++i does not.

Affected Lines: NounsDAOLogicV2.sol: Line 226 NounsDAOLogicV2.sol: Line 292 NounsDAOLogicV2.sol: Line 330 NounsDAOLogicV2.sol: Line 357 NounsDAOLogicV2.sol: Line 382

2. Using Custom errors instead of require()

Custom errors are more gas efficient than using require().

3. Initializing variables to zero or false costs more gas

Variables by default are set to zero.

Affected Lines: NounsDAOLogicV2.sol: Line 231 NounsDAOLogicV2.sol: Line 238-243

Using > 0 costs more gas than != 0

It is better to check if a number is greater than zero using != 0 as it saves 6 gas compared to > 0

Affected Lines: NounsDAOLogicV2.sol: Line 541 NounsDAOLogicV2.sol: Line 967

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