Project

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

Platform Fee Loss Due to Zero DAO Membership Price

Summary

The MembershipFactory contract has a vulnerability allowing DAO creators to set the membership tier price to zero or a very low value, resulting in zero platform fees for each user joining the DAO. This enables users to participate in a DAO without paying the platform fees, allowing free protocol usage.

Vulnerability Details

The vulnerability arises from a lack of price validation for each tier in the createNewDAOMembership function. DAO creators can set any price, including zero, for a membership tier. Since the platform fee calculation is based on a percentage of the tier price, setting the price to zero results in zero platform fees:

uint256 platformFees = (20 * tierPrice) / 100;

If tierPrice is zero, platformFees will also be zero, allowing users to join without contributing to the platform fees.

PoC:

function test_lose_of_fees_poc() public {
TierConfig memory tierConfig1;
tierConfig1.amount = 10;
tierConfig1.price = 0;
tierConfig1.power = 0;
tierConfig1.minted = 0;
TierConfig memory tierConfig2;
tierConfig2.amount = 10;
tierConfig2.price = 0;
tierConfig2.power = 1;
tierConfig2.minted = 0;
tierConfigs.push(tierConfig1);
tierConfigs.push(tierConfig2);
DAOInputConfig memory config;
config.ensname = "test";
config.daoType = DAOType.PUBLIC;
config.currency = address(weth);
config.maxMembers = 20;
config.noOfTiers = 2;
address daoMembershipAddress = membershipFactory.createNewDAOMembership(config, tierConfigs);
uint256 before_balance = weth.balanceOf(owpWalletAddress);
vm.startPrank(user);
vm.expectEmit();
emit UserJoinedDAO(user, daoMembershipAddress, 0);
membershipFactory.joinDAO(daoMembershipAddress, 0);
vm.stopPrank();
uint256 after_balance = weth.balanceOf(owpWalletAddress);
assertEq(before_balance, after_balance);
}

Impact

Zero revenue collection on user onboarding to DAOs.

Tools Used

Manual Review

Recommendations

A minimum price check should be introduced for each tier in the createNewDAOMembership function to address this issue.

Updates

Lead Judging Commences

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.