Crate dao_dao_macros
source ·Expand description
§CosmWasm DAO Macros
This package provides a collection of macros that may be used to derive DAO module interfaces on message enums. For example, to derive the voting module interface on an enum:
use cosmwasm_schema::{cw_serde, QueryResponses};
use dao_dao_macros::{cw20_token_query, voting_module_query};
use dao_interface::voting::TotalPowerAtHeightResponse;
use dao_interface::voting::VotingPowerAtHeightResponse;
#[cw20_token_query]
#[voting_module_query]
#[cw_serde]
#[derive(QueryResponses)]
pub enum Query {}
Attribute Macros§
- Adds the necessary fields to an enum such that it implements the interface needed to be a voting module that has an active check threshold.
- Adds the necessary fields to an enum such that it implements the interface needed to be a voting module with a cw20 token.
- Limits the number of variants allowed on an enum at compile time. For example, the following will not compile:
- Adds the necessary fields to an enum such that it implements the interface needed to be a voting module with a native token.
- Adds the necessary fields to an enum such that it implements the interface needed to be a proposal module.
- Adds the necessary fields to an enum such that the enum implements the interface needed to be a voting module.