The castVote
function does not allow users to update their vote once it has been cast. If a user votes for
a proposal but later decides to vote against
(or vice versa), they cannot change their decision. This limitation reduces the flexibility and usability of the governance system.
Root Cause:
The issue stems from the following logic in the castVote
function:
Once a user has voted, the hasVoted
mapping is set to true
, preventing them from voting again.
There is no mechanism to update or change a vote.
Reduced Flexibility: Users cannot change their vote if they change their mind or make a mistake.
Inefficient Governance: Votes may not accurately reflect the current preferences of the community.
User Frustration: Users may feel locked into their initial decision, reducing engagement in the governance process.
Example Scenario:
A user votes for
a proposal with their full voting power.
After further consideration, the user decides to vote against
the proposal.
The user attempts to call castVote
again but is blocked by the AlreadyVoted
check.
The user's initial for
vote remains counted, even though it no longer reflects their preference.
Manual Review
To address this issue, implement a mechanism that allows users to update their vote.
Allow Vote Updates:
Modify the castVote
function to allow users to update their vote.
Subtract their previous vote weight before applying the new vote.
Example:
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.