Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

No Check on tierConfigs[i].price > 0 in createNewDAOMembership

createNewDAOMembership function, there is no validation to ensure that the price of each tier is greater than zero. Allowing tiers with a zero price may not align with the intended business logic and could lead to unintended free memberships.

Code Snippet:

for (uint256 i = 0; i < tierConfigs.length; i++)

{

require(tierConfigs[i].minted == 0, "Invalid tier config"); // Missing validation: require(tierConfigs[i].price > 0, "Tier price must be greater than zero.");

dao.tiers.push(tierConfigs[i]);

}

Explanation:

Tiers with a price of zero enable users to join the DAO for free.

If the DAO does not intend to offer free memberships, this could be a problem.

Recommendation

  • Add Validation for Tier Price:

    require(tierConfigs[i].price > 0, "Tier price must be greater than zero.");

    If zero-priced tiers are acceptable in certain contexts (e.g., free membership levels), make this explicit in the business logic and document it clearly.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge
about 1 year ago
0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!