A user can upgrade his tier even when the target tier is at full capacity because there is no check to ensure that the new tier has available capacity for minting before executing the upgrade.
When a user upgrades from one tier to another, the function does not reflect the change in both old and new tier's minted
count
In contract MembershipFactory
, the joinDAO
function allows a user to join a DAO by purchasing a membership NFT, it will check whether the tier is full:
However, there is no such check in upgradeTier
function:
This absence of a safety check permits a user to upgrade their tier even when the target tier is at full capacity (i.e., when the number of minted
NFTs equals or exceeds the amount
configured for that tier).
In joinDAO
function, it will increase the minted
count:
However, there is no such change in upgradeTier
function. When a user upgrades from one tier to another, the function currently burns 2 tokens from the fromTierIndex
tier but doesn't decrease the minted
count for that old tier. It also mints 1 tokens to the fromTierIndex
-1 tier but doesn't increase the minted
count for that new tier. This inconsistency can lead to situations where the sum of minted
NFTs across tiers exceeds the configured amount
, violating the intended constraints and limits imposed on tier capacities.
It could lead to an erroneous state where a user holds a membership NFT in a tier that should not accept any more members, leading to a violation of the membership structure's intended constraints. It will also lead to situations where the sum of minted
NFTs across tiers exceeds the configured amount
Manual Review
Consider following 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.