Nouns Builder contest - fatherOfBlocks'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: 63/168

Findings: 3

Award: $176.86

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: chatch

Also found by: 0x4non, Chom, R2, ak1, ayeslick, fatherOfBlocks, hyh, rvierdiiev, scaraven, simon135, zzzitron

Labels

bug
duplicate
2 (Med Risk)
sponsor disputed

Awards

70.6842 USDC - $70.68

External Links

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/governance/governor/Governor.sol#L160-L166 https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/governance/governor/Governor.sol#L434-L438

Vulnerability details

Impact

When a proposal is created, the values ​​of voteStart and voteEnd are set, but when they are set, their values ​​are not validated: block.timestamp + settings.votingDelay and block.timestamp + settings.votingPeriod, be > block.timestamp. This is necessary because if the two values ​​were equal: voteStart == voteEnd would generate certain inconsistencies, for example: that the state() function returns Pending, when there is no real time to vote. In addition, there would be the problem of creating a proposal that will never be able to be voted on.

This could be fixed by validating that voteStart has to be > voteEnd

#0 - GalloDaSballo

2022-09-17T01:48:30Z

You'd want to require votingPeriod to be non-zero in the setter.

I think this is QA but will think about it

#1 - iainnash

2022-09-26T19:03:18Z

I think someone else correctly called out votingPeriod to be nonZero in the setter. Would also argue for QA since this is a permissioned call and does not directly call out where this issue is introduced.

#2 - GalloDaSballo

2022-09-26T23:25:06Z

Dup of #482 , while the immediate reaction was QA, other reports have shown specific ways to cause DOS and brick the governor

Treasury.sol

  • L141 - The execute() function has several arrays and they are used inside a for, but it is not validated that they have equal sizes so that they do not revert without displaying a correct message.

#0 - GalloDaSballo

2022-09-26T21:33:15Z

R

Treasury.sol

  • L162 - It is not necessary to initialize a variable with its default value since it generates an extra gas cost without having benefits in the understanding of the code.

Address L50 - It is less expensive to validate "variable != 0" than "variable > 0"

Metadata Renderer

  • L119/133/189/229 - It is not necessary to initialize a variable with its default value since it generates an extra gas cost without having benefits in the understanding of the code.

  • L124/151/194/226/237 - It is less expensive to make ++variable or --variable, than variable + 1 for example.

Token

  • L91/154 - It is less expensive to make ++variable or --variable, than variable + 1 for example.

#0 - GalloDaSballo

2022-09-26T15:59:55Z

L50 - It is less expensive to validate "variable != 0" than "variable > 0"

Only for require

50 gas overall

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