Project

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

When the value of tiers[tierIndex].price is set too low, the platformFees cannot be correctly charged.

Summary

In Solidity, integer division truncates the decimal part, leading to incorrect calculations of platformFees.

Vulnerability Details

In the file MembershipFactory.sol, at line 140, the function joinDAO is responsible for calculating and collecting platformFees. The calculation code is :

uint256 tierPrice = daos[daoMembershipAddress].tiers[tierIndex].price;
uint256 platformFees = (20 * tierPrice) / 100;

The variable tierPrice is set in the function createNewDAOMembership. Assuming it is set to a very small value like 1, the result of the platformFees calculation will be 0 due to integer division truncating the decimal part, which leads to the failure of collecting platformFees.

Impact

Failed to collect platformFees

Tools Used

Manual audit.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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