The createNewDAOMembership function in the MembershipFactory contract allows users to create DAOs with multiple tiers. However, the function currently lacks validation to ensure that the amount in each tierConfigs entry is greater than zero, allowing for the creation of useless, zero-capacity tiers that add no functional capacity to the DAO.
The createNewDAOMembership function checks that each tierConfigs[i].minted starts at zero to ensure tiers are initially empty. However, it does not validate the amount field, which defines each tier’s maximum capacity. Without this check, a user could create a DAO with tiers where amount is zero, resulting in tiers that no one can join. These “empty” tiers can lead to storage waste, operational inefficiencies, and user confusion.
This code does not validate tierConfigs[i].amount to ensure it is non-zero, allowing tiers with zero capacity to be added to the DAO.
Extra storage is used to hold zero-capacity tiers.
Users may attempt to join an empty tier, leading to failed transactions or confusion.
DAOs with meaningless tiers add complexity and waste gas on storage without providing functional utility.
Manual review.
To fix this issue, add a validation check within the loop to ensure that tierConfigs[i].amount is greater than zero:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.