Expand description

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.

Modules

Enums