Multi-Candidates election can be manipulated by submitting duplicate positions #6711
simpletrontdip
started this conversation in
General
Replies: 2 comments
-
|
Something like this may help const chosenCount = chosenPositions.length;
const uniqueCount = new Set(chosenPositions).size;
chosenCount === uniqueCount ||
Fail`Duplicated positions found`; |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I created an issue #6721. Thanks for reporting this! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, while reading through the code, I've found out that
submitVotedid not check for the uniqueness of positions.Since inside
countVotes, we only find the position index and add theshares, so some voters can exploit this to manipulate the election's result, say:agoric-sdk/packages/governance/src/multiCandidateVoteCounter.js
Lines 68 to 76 in ca0b874
agoric-sdk/packages/governance/src/multiCandidateVoteCounter.js
Lines 168 to 183 in ca0b874
Beta Was this translation helpful? Give feedback.
All reactions