Nouns DAO contest - ACai'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: 126/160

Findings: 1

Award: $16.66

🌟 Selected for report: 0

🚀 Solo Findings: 0

The scope of this report is NounsDAOLogicV1.sol .

propose function

Original code:

require( targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, 'NounsDAO::propose: proposal function information arity mismatch' ); require(targets.length != 0, 'NounsDAO::propose: must provide actions'); require(targets.length <= proposalMaxOperations, 'NounsDAO::propose: too many actions');

It is recommended to change to:

uint256 targetsLen = targets.length;
uint256 valuesLen = values.length;
uint256 signaturesLen = signatures.length;
uint256 calldatasLen = calldatas.length;

require(
    targetsLen == valuesLen &&
        targetsLen == signaturesLen &&
        targetsLen == calldatasLen,
    'NounsDAO::propose: proposal function information arity mismatch'
);
require(targetsLen != 0, 'NounsDAO::propose: must provide actions');
require(targetsLen <= proposalMaxOperations, 'NounsDAO::propose: too many actions');

queue, execute, cancel, veto functions

Original code:

for (uint256 i = 0; i < proposal.targets.length; i++) {
    ...
}

It is recommended to change to:

uint256 targetsLen = proposal.targets.length;
for (uint256 i = 0; i < targetsLen; i++) {
    ...
}

castVoteBySig, castVote, castVoteWithReason functions

Original code:

emit VoteCast(signatory, proposalId, support, castVoteInternal(signatory, proposalId, support), '');

It is recommended to change to:

uint96 votes = castVoteInternal(signatory, proposalId, support);
emit VoteCast(signatory, proposalId, support, votes, '');
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