Skip to content

feat: multichoice#636

Open
pscott wants to merge 7 commits intodevelopfrom
feat_multichoice
Open

feat: multichoice#636
pscott wants to merge 7 commits intodevelopfrom
feat_multichoice

Conversation

@pscott
Copy link
Contributor

@pscott pscott commented Nov 15, 2024

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/2 choice, we now have an Array of choices. Upon proposal creation, a number of choices is passed in to specify the number of choices possible for this proposal.

Interface changes

The execute function of a voting strategy replaces votes_for, votes_against, votes_abstain by a single array votes.
The same goes for get_proposal_status.
The vote_power takes a u128 instead of an enum. Same goes for fn vote on the space contract.
The propose function on the space contract now takes a choices: u128 parameter that represents the number of choices. Same goes for the update_proposal function.

Typehashes for signature are modified see starknet/src/utils/constants.cairo.
The choice enum 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 the votes[] array as an array of 3 elements, containing for / against / abstain votes.

@pscott pscott marked this pull request as ready for review November 26, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant