Project

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

Tier Pricing System is not enforced, thus the `Value` and the `Price` will not be Consistent

Summary

The protocol is not fair. The value and price of a tier is not correlated. Either control both the price increase in the contract or leave both the price and weight of token up to the DAO creator.

Vulnerability Details

The related code is here:
https://github.com/Cyfrin/2024-11-one-world/blob/1e872c7ab393c380010a507398d4b4caca1ae32b/contracts/dao/MembershipFactory.sol#L155C2-L161C6
https://github.com/Cyfrin/2024-11-one-world/blob/1e872c7ab393c380010a507398d4b4caca1ae32b/contracts/dao/tokens/MembershipERC1155.sol#L169-L177

function shareOf(address account) public view returns (uint256) {
return (balanceOf(account, 0) * 64) +
(balanceOf(account, 1) * 32) +
(balanceOf(account, 2) * 16) +
(balanceOf(account, 3) * 8) +
(balanceOf(account, 4) * 4) +
(balanceOf(account, 5) * 2) +
balanceOf(account, 6);
}
function upgradeTier(address daoMembershipAddress, uint256 fromTierIndex) external {
require(daos[daoMembershipAddress].daoType == DAOType.SPONSORED, "Upgrade not allowed.");
require(daos[daoMembershipAddress].noOfTiers >= fromTierIndex + 1, "No higher tier available.");
IMembershipERC1155(daoMembershipAddress).burn(_msgSender(), fromTierIndex, 2);
IMembershipERC1155(daoMembershipAddress).mint(_msgSender(), fromTierIndex - 1, 1);
emit UserJoinedDAO(_msgSender(), daoMembershipAddress, fromTierIndex - 1);
}

The value is of tier increases by two, however the price does not have to correlate with it. The price is set by the DAO creator and can be whatever they want.

Impact

The protocol will not be fair and result in a bad user experience

Tools Used

hardhat and manual review

Recommendations

Have the DAO creator set one price and calculate the tier prices on chain or leave the weight and price of a DAO up to the creator.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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