Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for multichoice
This PR adds support for for multichoice (i.e not only for / against / abstain). This PR does not add support for weighted voting or ranked choice.
The way multichoice is added here is instead of having fixed
0/1/2choice, we now have anArrayof choices. Upon proposal creation, a number ofchoicesis passed in to specify the number of choices possible for this proposal.Interface changes
The
executefunction of a voting strategy replacesvotes_for, votes_against, votes_abstainby a single arrayvotes.The same goes for
get_proposal_status.The
vote_powertakes au128instead of an enum. Same goes forfn voteon the space contract.The
proposefunction on the space contract now takes achoices: u128parameter that represents the number of choices. Same goes for theupdate_proposalfunction.Typehashes for signature are modified see
starknet/src/utils/constants.cairo.The
choiceenum has been removed from the code.Note
Although the execution strategy now takes
votes[]as an array, it doesn't mean it should support any number of choices. For example, the l1 avatar executions strategy still uses a simple quorum, and will treat thevotes[]array as an array of 3 elements, containingfor / against / abstainvotes.