Nouns DAO contest - peritoflores'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: 130/160

Findings: 1

Award: $16.66

🌟 Selected for report: 0

🚀 Solo Findings: 0

Gas-Report for 2022-08-nounsdao

Reading msg.sender is much much cheaper than reading storage variable

Reading msg.sender cost 2 gas while reading a storage cost 2100 the first time and 100 the next.

https://github.com/code-423n4/2022-08-nounsdao/blob/45411325ec14c6d747b999a40367d3c5109b5a89/contracts/governance/NounsDAOLogicV2.sol#L247

latestProposalIds[newProposal.proposer] = newProposal.id; @audit gas replace newProposal.proposer for msg.sender

Gas saved: 98 per proposal call

Unnecessary check

https://github.com/code-423n4/2022-08-nounsdao/blob/45411325ec14c6d747b999a40367d3c5109b5a89/contracts/governance/NounsDAOLogicV2.sol#L606

You don't need to check support ==2 . Above you made the following check

require(support <= 2, 'NounsDAO::castVoteInternal: invalid vote type');

Add a comment instead

Use ! instead of == false

https://github.com/code-423n4/2022-08-nounsdao/blob/45411325ec14c6d747b999a40367d3c5109b5a89/contracts/governance/NounsDAOLogicV2.sol#L597

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