The updateDAOMembership function in the MembershipFactory contract contains a logical bug in the way the maxMembers value is updated. The bug cuases inconsistencies between the stored maxMembers value and the actual capacity of the DAO.
The updateDAOMembership function only updates maxMembers if the new calculated sum is greater than the existing value. It never decreases maxMembers when newly updated sum is less than the existing value.
The bug is in this particular line:
This logic only updates maxMembers if the new calculated total capacity (maxMembers) is greater than the existing value. It never decreases the maxMembers value, even if the new tier configuration has a lower total capacity.
For example:
Initial maxMembers: 200
Updated tier configuration total capacity: 100
However, the maxMembers value remains at 200 due to the bug.
Total members can be greater than the new maxMembers allowed.
Manual review
The updateDAOMembership function should directly update the maxMembers value to the new calculated total capacity, regardless of whether it is higher or lower than the existing value:
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.