Project

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

`MembershipERC1155::shareOf` will not return the right share value for user created DAOs

Vulnerability details

The MembershipERC1155::shareOf function hardcodes the weight value. The weights of user created DAOs might vary from what hard coded value.

/// @notice Calculates the share of total profits for an account
/// @param account The account to query
/// @return The weighted share of the account
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);
}

As we can see the hardcoded weight values are : 64, 32, 16, 8, 4, 2, 1 corresponding to tiers 0 to 6.
But in a user created DAO, the weight value can very well differ.

struct TierConfig {
uint256 amount;
uint256 price;
uint256 power;
uint256 minted;
}

The createNewDAOMembership function takes a custom TierConfig which means a dao creator can configure TierConfig.power according to their choice and it doesn't necessarily have to be same as the hardcoded values

function createNewDAOMembership(DAOInputConfig calldata daoConfig, TierConfig[] calldata tierConfigs){...}

As confirmed by the Sponsor the power in TierConfig struct means

Power is the voting weight in that DAO

Impact

shareOf function returns wrong value in case of user created DAOs.

This issue is being addressed by the Sponsor too

Just reviewing the logic this appears to handle the fixed tier sized DAOs - however there are potentially bugs in here for non-standard tiers.

Tools used

Manual review

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

tdey Submitter
10 months ago
0xbrivan2 Lead Judge
10 months ago
0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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