#proposal #dao #approval #module #contract #flow #single

dao-pre-propose-approval-single

A DAO DAO pre-propose module handling a proposal approval flow for for dao-proposal-single

7 stable releases

2.6.0 Nov 8, 2024
2.5.0 Oct 31, 2024
2.4.2 Jul 22, 2024
2.3.0 Oct 18, 2023
2.2.0 Jul 9, 2023

#803 in Magic Beans

Download history 232/week @ 2024-07-28 28/week @ 2024-08-04 280/week @ 2024-08-11 3/week @ 2024-08-18 14/week @ 2024-09-01 93/week @ 2024-09-08 55/week @ 2024-09-15 98/week @ 2024-09-22 33/week @ 2024-09-29 36/week @ 2024-10-06 149/week @ 2024-10-13 20/week @ 2024-10-20 284/week @ 2024-10-27 191/week @ 2024-11-03 24/week @ 2024-11-10

522 downloads per month

BSD-3-Clause

315KB
7K SLoC

Single choice proposal approval contract

dao-pre-propose-approval-single on crates.io docs.rs

This contract implements an approval flow for proposals, it also handles deposit logic. It works with the dao-proposal-single proposal module.

Approval Logic

This contract is instantatied with an approver address. This address is allowed to approve or reject the proposal. An approved proposal opens for voting immediately, whereas a rejected proposal is simply discarded.

      ┌──────────┐
      │          │
      │  Account │
      │          │
      └─────┬────┘
            │
            │ Makes prop
            ▼
┌────────────────────────┐               ┌────────────────────────┐
│                        │               │                        │
│  Pre-propose Approval  │ ◄─────────────┤    Approver Address    │
│                        │    Approves   │                        │
└───────────┬────────────┘    or rejects └────────────────────────┘
            │
            │ Creates prop
            │ on approval
            ▼
┌────────────────────────┐
│                        │
│     Proposal Single    │
│                        │
└───────────┬────────────┘
            │
            │ Normal voting
            │
            ▼
┌────────────────────────┐
│                        │
│       Main DAO         │
│                        │
└────────────────────────┘

The approver may also register a ProposalSubmitHook, which fires every time a proposal is submitted to the dao-pre-propose-approval-single contract.

Deposit Logic

It may accept either native (bank module), cw20 tokens, or no tokens as a deposit. If a proposal deposit is enabled the following refund strategies are avaliable:

  1. Never refund deposits. All deposits are sent to the DAO on proposal completion.
  2. Always refund deposits. Deposits are returned to the proposer on proposal completion and even rejection by the approver.
  3. Only refund passed proposals. Deposits are only returned to the proposer if the proposal is approved and passes. Otherwise, they are sent to the DAO.

This module may also be configured to only accept proposals from members (addresses with voting power) of the DAO.

Here is a flowchart showing the proposal creation process using this module:

Resources

More about the pre-propose design.

More about pre-propose modules.

Dependencies

~10MB
~210K SLoC