Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Founder ownership of 100% will prevent Founders from receiving any tokens at all #443

Closed
code423n4 opened this issue Sep 15, 2022 · 1 comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/token/Token.sol#L151-L157

Vulnerability details

Impact

When the total founder ownership is 100%, all NFT tokens which are minted will be automatically minted for the founders. However, as token.mint() will constantly increase tokenID, unbounded gas consumption occurs which will cause the external call to revert due to exceeding block gas limits, thereby pausing the auction contract without the founders receiving any NFTs. Therefore, the auction will only properly work once the founder's claim has expired, with founders not receiving a single NFT.

I believe medium severity is suitable as this issue breaks a pretty significant selling point of the protocol however requires that the founders setup the governance with 100% initial ownership

Proof of Concept

  1. Alice deploys the new governance protocol and sets founderPct = 100
  2. Alice starts the auction by calling unpause() in Auction.sol
  3. _createAuction() calls token.mint() which starts an infinite loop and reverts
  4. Due to the try/catch statement, the contract is paused and no auction can start

Tools Used

VS Code

Recommended Mitigation Steps

Add a check to make sure that founder ownership does not reach 100% e.g.
In _addFounders() from Token.sol add a greater or equal than sign:

if ((totalOwnership += uint8(founderPct)) >= 100) revert INVALID_FOUNDER_OWNERSHIP();
@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Sep 15, 2022
code423n4 added a commit that referenced this issue Sep 15, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #347

@GalloDaSballo GalloDaSballo added the duplicate This issue or pull request already exists label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants