In the updateDAOMembership
function, dao.maxMembers
is updated only if the new sum of members across tiers (maxMembers
) exceeds the current value of dao.maxMembers
. This condition prevents lowering the maximum number of DAO members when desired, limiting flexibility in adjusting membership constraints.
This is the updateDAOMembership function:
The function calculates the total number of members allowed across the updated tiers using this line:
This loop iterates over each tier in tierConfigs
, summing up the amount values (representing the maximum members allowed per tier) to obtain maxMembers
—the total number of members permitted across all tiers.
However, the subsequent line:
only updates dao.maxMembers
if the new maxMembers
total is greater than the existing dao.maxMembers
. As a result, this condition allows dao.maxMembers
variable to only increase but not decrease even if the new configuration specifies a lower maxMembers
value.
Example Scenario:
Step-1: Suppose dao.maxMembers
is initially set to 1,000 based on an initial tier configuration with three tiers. For example:
Tier 1: amount = 500
Tier 2: amount = 300
Tier 3: amount = 200
Calculating the sum, maxMembers
equals 1,000 (500 + 300 + 200), so dao.maxMembers
is set to 1,000.
Step-2: Now, the DAO administrator updates tierConfigs
to reduce the membership cap to a total of 800 members, adjusting the configuration to:
Tier 1: amount = 300
Tier 2: amount = 300
Tier 3: amount = 200
This results in a new maxMembers
value of 800 (300 + 300 + 200).
Step-3: Since 800 < 1,000, the condition maxMembers
> dao.maxMembers
is not met, so dao.maxMembers
remains at 1,000, disregarding the intended new limit of 800.
This results in dao.maxMembers
retaining a higher-than-intended value, contrary to the new configuration's membership constraints.
Prevents DAOs from enforcing a lower membership cap even if the `maxMembers` decreases as per the new configuration.
Manual 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.