Nouns Builder contest - lukris02's results

A permissionless, governed protocol to deploy nouns-style DAOs complete with treasury, generative collections, and governance mechanisms.

General Information

Platform: Code4rena

Start Date: 06/09/2022

Pot Size: $90,000 USDC

Total HM: 33

Participants: 168

Period: 9 days

Judge: GalloDaSballo

Total Solo HM: 10

Id: 157

League: ETH

Nouns Builder

Findings Distribution

Researcher Performance

Rank: 132/168

Findings: 1

Award: $60.77

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report for Nouns Builder contest

Overview

During the audit, 3 low and 5 non-critical issues were found.

Low Risk Findings (3)

L-1. Storage variables can be packed tightly

Description

According to docs, multiple, contiguous items that need less than 32 bytes are packed into a single storage slot if possible. It might be beneficial to use reduced-size types if you are dealing with storage values because the compiler will pack multiple elements into one storage slot, and thus, combine multiple reads or writes into a single operation.

Instances
uint16 proposalThresholdBps; uint16 quorumThresholdBps; Treasury treasury; uint48 votingDelay; uint48 votingPeriod;
uint96 totalSupply; IBaseMetadata metadataRenderer; uint8 numFounders; uint8 totalOwnership;
Recommendation

Consider changing order of variables to:

  • 1.
Treasury treasury; //PACKED uint16 proposalThresholdBps; uint16 quorumThresholdBps; uint48 votingDelay; uint48 votingPeriod;
IBaseMetadata metadataRenderer; //PACKED uint96 totalSupply; uint8 numFounders; uint8 totalOwnership;

L-2. Large number of items may cause out-of-gas error

Description

Loops that do not have a fixed number of iterations, for example, loops that depend on storage values, have to be used carefully: Due to the block gas limit, transactions can only consume a certain amount of gas. Either explicitly or just due to normal operation, the number of iterations in a loop can grow beyond the block gas limit, which can cause the complete contract to be stalled at a certain point.

Instances
Recommendation

Restrict the maximum number of items in loop.

L-3. Empty function bodies

Instances

Non-Critical Risk Findings (5)

NC-1. Public functions can be external

Description

If functions are not called by the contract where they are defined, they can be declared external.

Instances
Recommendation

Make public functions external, where possible.

NC-2. Order of Functions

Description

According to Style Guide, ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier.
Functions should be grouped according to their visibility and ordered:

  • constructor
  • receive function (if exists)
  • fallback function (if exists)
  • external
  • public
  • internal
  • private
Instances
  1. receive function in wrong place
  2. internal functions before public and (2)
  3. public and internal functions before external and (2), (3), (4)
  4. private and external functions between internal and (2), (3)
  5. public functions between external and (2)
  6. modifier after functions
Recommendation

Reorder functions where possible.

NC-3. Scientific notation may be used

Description

For readability, it is better to use scientific notation.

Instances

success := call(50000, _to, _amount, 0, 0, 0, 0)

Recommendation

Replace 50000 with 50e4.

NC-4. Missing NatSpec

Description

NatSpec is missing for 10 functions in 2 contracts.

Instances
Recommendation

Add NatSpec for all functions.

NC-5. Inconsistent use of named return variables

Description

Some functions return named variables, others return explicit values.

Instances

For example:

/// @notice The minimum percentage an incoming bid must raise the highest bid function minBidIncrement() external view returns (uint256); /// @notice Updates the time duration of each auction /// @param duration The new time duration function setDuration(uint256 duration) external;

#0 - GalloDaSballo

2022-09-15T23:12:42Z

Some good ideas

#1 - GalloDaSballo

2022-09-27T13:43:08Z

3R 1NC

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