Nouns DAO contest - delfin454000'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: 59/160

Findings: 2

Award: $52.11

🌟 Selected for report: 0

🚀 Solo Findings: 0

Long single line comments

In theory, comments over 79 characters should wrap using multi-line comment syntax. Even if somewhat longer comments are acceptable, there are cases where very long comments interfere with readability. Below are instances of extra-long comments whose readability could be improved by wrapping, as shown:


NounsDAOInterfaces.sol: L179-182

        /// @notice The number of votes needed to create a proposal at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 proposalThreshold;
        /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed at the time of proposal creation. *DIFFERS from GovernerBravo
        uint256 quorumVotes;

Suggestion:

        /// @notice The number of votes needed to create a proposal at the time
        ///   of proposal creation — *DIFFERS from GovernerBravo.
        uint256 proposalThreshold;
        /// @notice The minimum number of votes in support of a proposal required
        ///   in order for a quorum to be reached and for a vote to succeed at the time 
        ///   of proposal creation — *DIFFERS from GovernerBravo.
        uint256 quorumVotes;

Similarly for the following:

NounsDAOInterfaces.sol: L279-282

NounsDAOInterfaces.sol: L373-376


NounsDAOInterface.sol: L156

    /// @notice The basis point number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed. *DIFFERS from GovernerBravo

Suggestion:

    /// @notice The basis point number of votes in support of a proposal required in order 
    ///   for a quorum to be reached and for a vote to succeed — *DIFFERS from GovernerBravo.

Similarly for the following:

NounsDAOInterface.sol: L153

NounsDAOInterface.sol: L253

NounsDAOInterface.sol: L256


NounsDAOLogicV2.sol: L599

        /// @notice: Unlike GovernerBravo, votes are considered from the block the proposal was created in order to normalize quorumVotes and proposalThreshold metrics

Suggestion:

        /// @notice: Unlike GovernerBravo, votes are considered from the block the proposal
        ///   was created in order to normalize quorumVotes and proposalThreshold metrics.

Similarly for the following:

NounsDAOLogicV2.sol: L97

NounsDAOLogicV1.sol: L507

NounsDAOInterfaces.sol: L351

NounsDAOInterfaces.sol: L353

ERC721Checkpointable.sol: L40

ERC721Checkpointable.sol: L104

ERC721Checkpointable.sol: L198


NounsDAOLogicV2.sol: L900

     * @param params Configurable parameters for calculating the quorum based on againstVotes. See `DynamicQuorumParams` definition for additional details.

Suggestion:

     * @param params Configurable parameters for calculating the quorum based on againstVotes — 
     *   see `DynamicQuorumParams` definition for additional details.

NounsDAOLogicV2.sol: L796

     * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.

Suggestion:

     * @dev Admin function to begin change of admin — the newPendingAdmin 
     *   must call `_acceptAdmin` to finalize the transfer.

Similarly for the following:

NounsDAOLogicV1.sol: L594



Require message is inadequate

A revert string should provide enough information for users to understand reason for failure


NounsDAOLogicV2.sol: L1018-1021

    function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) {
        require(n <= type(uint32).max, errorMessage);
        return uint32(n);
    }

Similarly for the following:

ERC721Checkpointable.sol: L253-256

ERC721Checkpointable.sol: L258-261

ERC721Checkpointable.sol: L263-271

ERC721Checkpointable.sol: L273-280



Typos


The same typo (setable) occurs in all fifteen lines referenced below:

NounsDAOLogicV2.sol: L61

NounsDAOLogicV2.sol: L64

NounsDAOLogicV2.sol: L67

NounsDAOLogicV2.sol: L70

NounsDAOLogicV2.sol: L73

NounsDAOLogicV2.sol: L76

NounsDAOLogicV2.sol: L88

NounsDAOLogicV1.sol: L69

NounsDAOLogicV1.sol: L72

NounsDAOLogicV1.sol: L75

NounsDAOLogicV1.sol: L78

NounsDAOLogicV1.sol: L81

NounsDAOLogicV1.sol: L84

NounsDAOLogicV1.sol: L87

NounsDAOLogicV1.sol: L90

Example (NounsDAOLogicV2.sol: L61):

    /// @notice The minimum setable proposal threshold

Change setable to settable in each case


The same typo (contructor) occurs in both lines below:

NounsDAOLogicV2.sol: L115

NounsDAOLogicV1.sol: L104

     * @notice Used to initialize the contract during delegator contructor

Change contructor to constructor in both cases


The same typo (priviledges) occurs in both lines below:

NounsDAOLogicV2.sol: L848

NounsDAOLogicV1.sol: L646

     * @notice Burns veto priviledges

Change priviledges to privileges in both cases



Require revert string is too long

The revert strings below should be shortened to 32 characters or fewer to save gas or else consider using custom error codes, which could save even more gas

NounsDAOLogicV2.sol: L133

        require(address(timelock) == address(0), 'NounsDAO::initialize: can only initialize once');

Similarly for the following error messages:

NounsDAOLogicV2.sol: L133

Note that I have not included L134 since its string length is 32

NounsDAOLogicV2.sol: L135

NounsDAOLogicV2.sol: L136

NounsDAOLogicV2.sol: L139

NounsDAOLogicV2.sol: L143

NounsDAOLogicV2.sol: L147

NounsDAOLogicV2.sol: L199

NounsDAOLogicV2.sol: L205

NounsDAOLogicV2.sol: L207

NounsDAOLogicV2.sol: L208

NounsDAOLogicV2.sol: L215

NounsDAOLogicV2.sol: L219

NounsDAOLogicV2.sol: L288

NounsDAOLogicV2.sol: L314

NounsDAOLogicV2.sol: L326

NounsDAOLogicV2.sol: L347

NounsDAOLogicV2.sol: L353

Note that I have not included L375 and L376 since their string lengths are less than 32

NounsDAOLogicV2.sol: L377

NounsDAOLogicV2.sol: L433

NounsDAOLogicV2.sol: L577

NounsDAOLogicV2.sol: L593

NounsDAOLogicV2.sol: L594

NounsDAOLogicV2.sol: L597

NounsDAOLogicV2.sol: L622

NounsDAOLogicV2.sol: L625

NounsDAOLogicV2.sol: L638

NounsDAOLogicV2.sol: L641

NounsDAOLogicV2.sol: L655

NounsDAOLogicV2.sol: L659

NounsDAOLogicV2.sol: L674

NounsDAOLogicV2.sol: L680

NounsDAOLogicV2.sol: L684

NounsDAOLogicV2.sol: L702

NounsDAOLogicV2.sol: L707

NounsDAOLogicV2.sol: L711

NounsDAOLogicV2.sol: L727

NounsDAOLogicV2.sol: L801

NounsDAOLogicV2.sol: L819

NounsDAOLogicV2.sol: L840

NounsDAOLogicV2.sol: L853

NounsDAOLogicV1.sol: L122

Note that I have not included L123 since its string length is 32

NounsDAOLogicV1.sol: L124

NounsDAOLogicV1.sol: L125

NounsDAOLogicV1.sol: L128

NounsDAOLogicV1.sol: L132

NounsDAOLogicV1.sol: L136

NounsDAOLogicV1.sol: L189

NounsDAOLogicV1.sol: L195

NounsDAOLogicV1.sol: L197

NounsDAOLogicV1.sol: L198

NounsDAOLogicV1.sol: L205

NounsDAOLogicV1.sol: L209

NounsDAOLogicV1.sol: L277

NounsDAOLogicV1.sol: L303

NounsDAOLogicV1.sol: L315

NounsDAOLogicV1.sol: L336

NounsDAOLogicV1.sol: L342

NounsDAOLogicV1.sol: L364

Note that I have not included L365 since its string length is 28

NounsDAOLogicV1.sol: L366

NounsDAOLogicV1.sol: L422

NounsDAOLogicV1.sol: L485

NounsDAOLogicV1.sol: L501

NounsDAOLogicV1.sol: L502

NounsDAOLogicV1.sol: L505

NounsDAOLogicV1.sol: L530

NounsDAOLogicV1.sol: L533

NounsDAOLogicV1.sol: L546

NounsDAOLogicV1.sol: L549

NounsDAOLogicV1.sol: L563

NounsDAOLogicV1.sol: L567

NounsDAOLogicV1.sol: L581

NounsDAOLogicV1.sol: L584

NounsDAOLogicV1.sol: L599

NounsDAOLogicV1.sol: L617

NounsDAOLogicV1.sol: L638

NounsDAOLogicV1.sol: L651

NounsDAOProxy.sol: L79

NounsDAOProxy.sol: L80

ERC721Checkpointable.sol: L140

ERC721Checkpointable.sol: L141

ERC721Checkpointable.sol: L142

ERC721Checkpointable.sol: L164

ERC721Enumerable.sol: L62

ERC721Enumerable.sol: L77



I was not able to work on the other gas optimization opportunities



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