castVote() uses _veToken.getVotingPower()
which gets the CURRENT voting power, rather than _veToken.getVotingPowerForProposal()
which gets the voting power at the proposal's snapshot block. This is incorrect - votes should use the snapshotted voting power to prevent vote manipulation through token purchases after a proposal is created. The code ought to be:
Users can increase their voting power after a proposal has been created and use that to vote. The reverse is also true i.e. a user who had some voting power when the proposal was created may not have it after a few days (within the votingPeriod of 7 days while the voting is still open) & hence loses the opportunity to rightfully exercise their vote.
Note that another variation to this is:
User has voting power and votes.
Before the proposal voting ends, user's locked tokens expire.
The expired tokens can be transferred to another wallet, then locked once again and used for voting on the same proposal, leading to double-voting.
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.