The upgradeTier function in the DAO contract has incorrect logic, which may allow users to effectively "downgrade" rather than upgrade their tier due to a logical flaw in the index handling. Instead of allowing a user to advance to a higher tier, the function deducts the user's current tier tokens and grants a token for a lower tier. This behavior deviates from the intended function of allowing users to upgrade within the DAO's tier structure.
The purpose of the upgradeTier function is to allow users to advance to a higher membership level within a DAO by upgrading their tier. However, due to a mistake in the code, the function does the opposite of what is intended—it effectively downgrades the user to a lower tier.
In the above code, the mint function is called with fromTierIndex - 1, which actually mints the token for a lower tier than the user currently holds. For example, if a user is at fromTierIndex = 2, they would expect an upgrade to fromTierIndex = 3. However, the code mistakenly issues a token for fromTierIndex = 1, effectively downgrading the user.
PoC:
Setup the contract with two DAO tiers: Tier 1 and Tier 2.
User joins the DAO at Tier 1.
User attempts to upgrade to Tier 2.
Observe that the user is incorrectly downgraded to a lower tier.
The incorrect logic in the upgradeTier function significantly impacts users attempting to advance within the DAO. Instead of upgrading, users will find themselves mistakenly assigned to a lower tier, which could lead to:
Confusion and frustration among DAO members.
Potential financial loss if DAO members have paid for higher tiers only to be placed in lower tiers.
Manual review.
To correct this issue, modify the upgradeTier function to mint tokens for the next tier rather than the previous one.
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.