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§

active_query
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.
cw20_token_query
Adds the necessary fields to an enum such that it implements the interface needed to be a voting module with a cw20 token.
limit_variant_count
Limits the number of variants allowed on an enum at compile time. For example, the following will not compile:
native_token_query
Adds the necessary fields to an enum such that it implements the interface needed to be a voting module with a native token.
proposal_module_query
Adds the necessary fields to an enum such that it implements the interface needed to be a proposal module.
voting_module_query
Adds the necessary fields to an enum such that the enum implements the interface needed to be a voting module.