Founder ownership of 100% will prevent Founders from receiving any tokens at all #443
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
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 increasetokenID
, 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
founderPct = 100
unpause()
inAuction.sol
_createAuction()
callstoken.mint()
which starts an infinite loop and revertsTools Used
VS Code
Recommended Mitigation Steps
Add a check to make sure that founder ownership does not reach 100% e.g.
In
_addFounders()
fromToken.sol
add a greater or equal than sign:The text was updated successfully, but these errors were encountered: