abstract_cw3_flex_multisig/
msg.rs

1use abstract_cw3::{UncheckedDepositInfo, Vote};
2use abstract_cw4::MemberChangedHookMsg;
3use cosmwasm_schema::{cw_serde, QueryResponses};
4use cosmwasm_std::{CosmosMsg, Empty};
5use cw_utils::{Duration, Expiration, Threshold};
6
7use crate::state::Executor;
8
9#[cw_serde]
10pub struct InstantiateMsg {
11    // this is the group contract that contains the member list
12    pub group_addr: String,
13    pub threshold: Threshold,
14    pub max_voting_period: Duration,
15    // who is able to execute passed proposals
16    // None means that anyone can execute
17    pub executor: Option<Executor>,
18    /// The cost of creating a proposal (if any).
19    pub proposal_deposit: Option<UncheckedDepositInfo>,
20}
21
22// TODO: add some T variants? Maybe good enough as fixed Empty for now
23#[cw_serde]
24#[derive(cw_orch::ExecuteFns)]
25pub enum ExecuteMsg {
26    Propose {
27        title: String,
28        description: String,
29        msgs: Vec<CosmosMsg<Empty>>,
30        // note: we ignore API-spec'd earliest if passed, always opens immediately
31        latest: Option<Expiration>,
32    },
33    Vote {
34        proposal_id: u64,
35        vote: Vote,
36    },
37    Execute {
38        proposal_id: u64,
39    },
40    Close {
41        proposal_id: u64,
42    },
43    /// Handles update hook messages from the group contract
44    MemberChangedHook(MemberChangedHookMsg),
45}
46
47// We can also add this as a cw3 extension
48#[cw_serde]
49#[derive(QueryResponses, cw_orch::QueryFns)]
50pub enum QueryMsg {
51    #[returns(cw_utils::ThresholdResponse)]
52    Threshold {},
53    #[returns(abstract_cw3::ProposalResponse)]
54    Proposal { proposal_id: u64 },
55    #[returns(abstract_cw3::ProposalListResponse)]
56    ListProposals {
57        start_after: Option<u64>,
58        limit: Option<u32>,
59    },
60    #[returns(abstract_cw3::ProposalListResponse)]
61    ReverseProposals {
62        start_before: Option<u64>,
63        limit: Option<u32>,
64    },
65    #[returns(abstract_cw3::VoteResponse)]
66    Vote { proposal_id: u64, voter: String },
67    #[returns(abstract_cw3::VoteListResponse)]
68    ListVotes {
69        proposal_id: u64,
70        start_after: Option<String>,
71        limit: Option<u32>,
72    },
73    #[returns(abstract_cw3::VoterResponse)]
74    Voter { address: String },
75    #[returns(abstract_cw3::VoterListResponse)]
76    ListVoters {
77        start_after: Option<String>,
78        limit: Option<u32>,
79    },
80    /// Gets the current configuration.
81    #[returns(crate::state::Config)]
82    Config {},
83}