#proposal #dao #module #voting #choice #vote #hook

dao-proposal-multiple

A DAO DAO proposal module for multiple choice (a or b or c or ...) voting

2 stable releases

2.3.0 Oct 18, 2023
2.2.0 Jul 9, 2023
2.1.5 Jul 6, 2023
2.1.0 Jul 3, 2023
0.0.0 Jul 3, 2023

#2535 in Magic Beans

Download history 6/week @ 2024-02-19 4/week @ 2024-02-26 11/week @ 2024-03-11 73/week @ 2024-04-01

84 downloads per month

BSD-3-Clause

485KB
12K SLoC

dao-proposal-multiple

dao-proposal-multiple on crates.io docs.rs

A proposal module for a DAO DAO DAO which allows the users to select their voting choice(s) from an array of MultipleChoiceOption. Each of the options may have associated messages which are to be executed by the core module upon the proposal being passed and executed.

Votes can be cast for as long as the proposal is not expired. In cases where the proposal is no longer being evaluated (e.g. met the quorum and been rejected), this allows voters to reflect their opinion even though it has no effect on the final proposal's status.

You can read more about this module in our wiki.

Undesired behavior

The undesired behavior of this contract is tested under testing/adversarial_tests.rs.

In general, it should cover:

  • Executing unpassed proposals
  • Executing proposals more than once
  • Social engineering proposals for financial benefit
  • Convincing proposal modules to spend someone else's allowance

Proposal deposits

Proposal deposits for this module are handled by the dao-pre-propose-multiple contract.

Hooks

This module supports hooks for voting and proposal status changes. One may register a contract to receive these hooks with the AddVoteHook and AddProposalHook methods. Upon registration the contract will receive messages whenever a vote is cast and a proposal's status changes (for example, when the proposal passes).

The format for these hook messages can be located in the proposal-hooks and vote-hooks packages located in packages/proposal-hooks and packages/vote-hooks respectively.

To stop an invalid hook receiver from locking the proposal module receivers will be removed from the hook list if they error when handling a hook.

Revoting

The proposals may be configured to allow revoting. In such cases, users are able to change their vote as long as the proposal is still open. Revoting for the currently cast option will return an error.

Dependencies

~9.5MB
~203K SLoC