Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multichoice #636

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

feat: multichoice #636

wants to merge 7 commits into from

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