When the admin tries to update the DAO membership, the function doesn't compare the number of current tiers with the number of new tiers. This makes impossible to to update DAO membership to lower tier quantity.
First of all let's take a look on the update funtion:
It first performs the necessary checks, then saves the values from the current tier, clears the array and finally adds new values to the empty array.
The problem is that the function does not compare the current number of tiers with the new one.
For example, we create or DAO with 7 tiers. Later we decided that we do not need Tier #7, and call the update function with new 6 tiers instead of 7.
Here the previous minted values will be copied and saved:
But current 7th Tiers will be missed from this loop as no 7 tier was added for update. So the array will ount of bound and the function reverts.
In the event of a requirement, it will not be possible to update the DAO to lower tier quantities, but it is possible to update to higher tier quantities.
Manual review
Consider fixing the number of tiers for each DAO from the moment it is created. Otherwise, it's better to refund or upgrade the user to the next tier in case the tier number shrinks.
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.