Nouns Builder contest - volky'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: 48/168

Findings: 3

Award: $291.22

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)
upgraded by judge

Awards

49.075 USDC - $49.08

External Links

Judge has assessed an item in Issue #357 as Medium risk. The relevant finding follows:

#0 - GalloDaSballo

2022-09-27T14:47:42Z

_addFounders allow founders to own all tokens

The _addFounders method allows setting the founders percent ownership to 100%, which then makes minting tokens impossible because it hangs on an infinite loop.

To fix that and reject the contract creation with 100% funders ownership, this line should be changed to

if ((totalOwnership += uint8(founderPct)) >= 100) revert INVALID_FOUNDER_OWNERSHIP(); That is, use a >= comparison instead of >

#1 - GalloDaSballo

2022-09-27T14:47:59Z

Dup of #347

_addFounders allow founders to own all tokens

The _addFounders method allows setting the founders percent ownership to 100%, which then makes minting tokens impossible because it hangs on an infinite loop.

To fix that and reject the contract creation with 100% funders ownership, this line should be changed to

if ((totalOwnership += uint8(founderPct)) >= 100) revert INVALID_FOUNDER_OWNERSHIP();

That is, use a >= comparison instead of >

_isForFounder function name is misleading

The name and return type of the function makes it look like it is read-only and has no side effects on the contract, while it actually mints tokens.

I suggest changing it to _performScheduledMint to be consistent with the terminology used on other parts of the contract

Unused ITreasury error EXECUTION_EXPIRED

The EXECUTION_EXPIRED error was declared but never used

use string.concat for concatenation on MetadataRenderer

use string.concat instead of abi.encodePacked where simple string concatenation is needed for better readability:

typos

psuedo-random => pseudo-random

#0 - GalloDaSballo

2022-09-27T01:13:09Z

_addFounders allow founders to own all tokens

TODO

_isForFounder function name is misleading

R

Unused ITreasury error EXECUTION_EXPIRED

R

use string.concat for concatenation on MetadataRenderer

R

Typo

NC

3R 1NC

Use less storage on Auction contract

Considering the following assumptions:

It's safe to assume that a tokenId won't realistically overflow an uint48 in the contract operational timespan.

With that assumption, we can usa a uint48 instead of uint256 on Auction.tokenId and move it down above uint40 startTime to save storage gas with the struct packing.

For consistency, it can be made an uint96 to match the Token Setting.totalSupply while still fitting in a packed uint256

use less storage on Governor.settings

The Governor Settings struct can be tightly packed and use one less storage slot (4 instead of 5) if its members are reordered to:

struct Settings { Token token; Treasury treasury; address vetoer; uint16 proposalThresholdBps; uint16 quorumThresholdBps; uint48 votingDelay; uint48 votingPeriod; }

redundant/unreachable EXECUTION_NOT_READY revert on Treasury.execute

On Treasury.execute there's a check for the execution readiness of the proposal, which will never be truthy because the only possible execution of this function (onlyOwner modifier) is via Governor.execute, which already checks if the proposal is queued and reverts otherwise

#0 - GalloDaSballo

2022-09-26T20:43:07Z

4k on average

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