2 unstable releases

0.1.0 Jul 3, 2023
0.0.0 Jul 3, 2023

#3 in #votes

Download history 98/week @ 2024-01-07 6/week @ 2024-01-14 13/week @ 2024-01-21 58/week @ 2024-01-28 127/week @ 2024-02-04 43/week @ 2024-02-11 43/week @ 2024-02-18 44/week @ 2024-02-25 35/week @ 2024-03-03 52/week @ 2024-03-10 93/week @ 2024-03-17 208/week @ 2024-03-24 112/week @ 2024-03-31 70/week @ 2024-04-07 79/week @ 2024-04-14 71/week @ 2024-04-21

335 downloads per month
Used in 4 crates (3 directly)

Apache-2.0

390KB
10K SLoC

cw-proposal-single

A proposal module for a DAO DAO DAO which supports simple "yes", "no", "abstain" voting. Proposals may have associated messages which will be executed by the core module upon the proposal being passed and executed.

For more information about how these modules fit together see this wiki page.

For information about how this module counts votes and handles passing thresholds see this wiki page.

Proposal deposits

This contract may optionally be configured to require a deposit for proposal creation. Currently, any cw20 token may be used.

As a convienence one may specify that the module should use the same token as the DAO's voting module using the VotingModuleToken variant when specifying information about the deposit. For this to work the voting module associated with the DAO must support the TokenContract query. This query may be derived via the #[token_query] macro.

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.

Dependencies

~4–5.5MB
~121K SLoC