The cancel function is documented (in comments) to allow "automatic cancellation if the proposer loses required voting power." However, the implementation does not automatically cancel proposals when the proposer's voting power falls below the threshold. Instead, the function reverts if proposer's voting power falls below threshold, meaning cancellation is not automatic executed.
Affected Function:
Issue:
The comment states that the proposal should be automatically cancelled if the proposer's voting power falls below the required threshold. However, the function merely reverts if a non-proposer calls cancel while the proposer still holds sufficient voting power, and does nothing to trigger automatic cancellation when the threshold is no longer met.
Expected Behavior:
The proposal should be cancelled automatically (or at least allow any user to cancel without reverting) once the proposer's voting power drops below proposalThreshold. This could be achieved by automatically setting proposal.canceled = true without requiring an external call that checks the voting power.
Inconsistent Proposal State:
Proposals may remain active even after the proposer's voting power falls below the required threshold, which could undermine the governance process.
Manual Code Review
Implement Automatic Cancellation Logic:
Modify the cancel function (or add a separate mechanism) to automatically cancel proposals when the proposer's voting power drops below the threshold without requiring an external cancellation call.
Update Documentation:
Ensure that the documentation accurately reflects the implemented behavior if automatic cancellation is not feasible, or update the code to match the intended functionality.
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.