The upgradeTier() function contains three critical flaws: potential arithmetic underflow, inverted tier availability check, and missing validation for highest tier upgrades.
In MembershipFactory.sol, upgradeTier() has several logical issues:
This creates three specific vulnerabilities:
Arithmetic underflow when upgrading from tier 0
Logically inconsistent tier availability check
No guard against upgrading from highest tier
Function reverts when attempting to upgrade from tier 0 due to underflow
Incorrect tier availability validation
Confusing user experience with inconsistent tier logic
Manual code review
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.