MembershipFactory::updateDAOMembership allows removing tiers without checking for existing tokens, leading to lost token tracking and broken profit distribution calculations.
During the tier removal process in MembershipFactory::updateDAOMembership, there's no validation of existing tokens in tiers being removed. Minted tokens remain in ERC1155 contract, and DAO configuration loses track of them after removal.
Profit distribution calculation uses tier-based weighting (2^(6-tier)), and the removed tiers' tokens still contribute to total supply, leading to incorrect weight calculations.
Token tracking becomes inconsistent, leading to:
Minted tokens in removed tiers still exist in ERC1155 contract, but DAO configuration loses track of them
Total supply calculations become incorrect
Profit distribution weights become inaccurate
Let's assume the following scenario:
DAO has 3 tiers: 0, 1, 2
50 tokens minted for tier 0
30 tokens minted for tier 1
20 tokens minted for tier 2
Admin removes tier 2
20 tokens from tier 2 are left behind in the ERC1155 contract, accounted for in total supply and profit distribution is now wrong
Total supply is off by 20 * 2^(6-2) = 320 weight units
MembershipFactory.sol#L114-L118
Manual Review
Add a check to ensure no tokens are left behind in removed tiers:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.