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
Rank: 62/168
Findings: 3
Award: $188.58
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: zzzitron
Also found by: 0xSmartContract, ChristianKuri, ElKu, Lambda, MiloTruck, davidbrai, elad, hansfriese, immeas, ladboy233, scaraven, volky
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L157 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L179-L190
In the case of founder shares totalOwnership
reaching 100, e.g. with a single founder owning the entire 100%, the mint function seems stuck in an infinite loop because all token IDs are founder tokens, at least until the founder vesting timestamp is reached.
I made minor changes to Token to allow my test to include minimal setup, then wrote a short test function sharing it below.
initializer
modifier from the constructormetadataRenderer.onMinted
to avoid having to provide a renderer or mock onefunction test_mint() public { address founder = address(0xabc); address renderer = address(0xbbb); address auction = address(0xccc); Token token = new Token(address(this)); IManager.FounderParams[] memory _founders = new IManager.FounderParams[](1); _founders[0] = IManager.FounderParams({ wallet: founder, ownershipPct: 100, vestExpiry: block.timestamp + 30 seconds }); token.initialize(_founders, abi.encode("name", "symbol", "desc", "image", "base"), renderer, auction); vm.prank(auction); token.mint(); }
forge test
#0 - GalloDaSballo
2022-09-20T19:47:21Z
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L363 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L128
It seems a bug that the propose
function lets you propose when you have exactly proposalThreshold
votes, while cancel
lets anyone cancel your proposal. Such a proposer should not be considered as spammy.
It's easy to see from the lines of code linked above that the comparisons don't match well between the two functions.
Github
In the cancel
function change the following code:
if (msg.sender != proposal.proposer && getVotes(proposal.proposer, block.timestamp - 1) > proposal.proposalThreshold) revert INVALID_CANCEL();
to be
if (msg.sender != proposal.proposer && getVotes(proposal.proposer, block.timestamp - 1) >= proposal.proposalThreshold) revert INVALID_CANCEL();
making it an INVALID_CANCEL
when getVotes
returns exactly proposal.proposalThreshold
.
#0 - Chomtana
2022-09-19T07:51:04Z
Dup #589
#1 - GalloDaSballo
2022-09-20T21:01:39Z
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/metadata/MetadataRenderer.sol#L194 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/metadata/MetadataRenderer.sol#L144-L160
It's confusing UX to allow users to add more items than 65535 in the addProperties
function, while limiting the ID range in use in onMinted
in the referenced line. They might think they added items that will be used but that won't be the case.
I think the limit of 65535 is fine, I would make it clear in the docs, and I would revert in addProperties
if that number is reached.
#0 - GalloDaSballo
2022-09-25T23:14:30Z
I think this submission barely makes the cut, but I'll bulk as the Dup of max 15 properties
Dup of #523