The `upgradeTier` function in the MembershipFactory contract contains a logic flaw related to tier index handling.
below is the upgradeTier() function:
Specifically, the function assumes that fromTierIndex - 1 is always a valid higher tier. However, if fromTierIndex is 0
, this logic results in an attempt to mint a token for fromTierIndex - 1, which evaluates to -1. This is an invalid index and can lead to unexpected behavior or errors.
unexpected behaviour
implement a check if the fromTierIndex=0 then the function should revert
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.