The upgradeTier function in contract MembershipFactory fails to update the tier minting counts when users upgrade their tiers in sponsored DAOs. While the function correctly burns and mints the appropriate membership NFTs, it does not update the minted counter in the corresponding tier configurations. This leads to inaccurate tracking of tier availability and could potentially allow bypassing of tier membership limits.
The issue exists in the upgradeTier function of the MembershipFactory contract:
When a user upgrades their tier:
Two tokens are burned from their current tier (fromTierIndex)
One token is minted in the next higher tier (fromTierIndex - 1)
However, the minted counter in daos[daoMembershipAddress].tiers[index].minted is not updated for either tier
This contrasts with the joinDAO function which properly maintains these counters:
The minted counter is critical because it's used to enforce tier capacity limits, as seen in the require statement in joinDAO. When these counters become out of sync with the actual number of minted tokens, the tier capacity enforcement mechanism becomes unreliable.
The failure to update tier minting counts during upgrades has several implications:
1.Inaccurate Tier Availability Tracking
Lower tiers may appear to have more availability than they actually do, as burned tokens aren't decremented from the minted count
Higher tiers may appear full when they actually have space available, as newly minted tokens aren't reflected in the minted count
2.Potential Tier Limit Bypass
If a tier's minted count becomes significantly out of sync with reality, users might be able to join tiers that should be full
This could lead to tiers exceeding their intended capacity limits set by amount
3.Inconsistent State
The actual number of NFTs minted (tracked by ERC1155) will not match the DAO's internal tracking
This makes it difficult for the protocol to maintain accurate membership statistics and could affect governance mechanisms that rely on tier information
4.Administrative Confusion
DAO administrators may make decisions based on incorrect tier occupancy data
This could affect pricing strategies, membership drives, or other DAO operations
Manual Review
The upgradeTier function should be modified to properly update the tier counters. Here's the recommended fix:
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.