komple_framework_fee_module/
state.rs

1use cosmwasm_schema::cw_serde;
2use komple_framework_types::shared::{
3    CONFIG_NAMESPACE, EXECUTE_LOCK_NAMESPACE, OPERATORS_NAMESPACE, PARENT_ADDR_NAMESPACE,
4};
5
6use cosmwasm_std::Addr;
7use cw_storage_plus::{Item, Map};
8use komple_framework_types::modules::fee::{
9    FixedPayment, PercentagePayment, FIXED_FEES_NAMESPACE, PERCENTAGE_FEES_NAMESPACE,
10};
11
12/// General config for the contract.
13#[cw_serde]
14pub struct Config {
15    pub admin: Addr,
16}
17pub const CONFIG: Item<Config> = Item::new(CONFIG_NAMESPACE);
18
19/// The fees that are percentage.
20///
21/// Module name and fee name are used as the key.
22/// ```PercentagePayment``` is the value.
23pub const PERCENTAGE_FEES: Map<(&str, &str), PercentagePayment> =
24    Map::new(PERCENTAGE_FEES_NAMESPACE);
25
26/// The fees that are fixed.
27///
28/// Module name and fee name are used as the key.
29/// ```FixedPayment``` is the value.
30pub const FIXED_FEES: Map<(&str, &str), FixedPayment> = Map::new(FIXED_FEES_NAMESPACE);
31
32/// Hub module address.
33pub const HUB_ADDR: Item<Addr> = Item::new(PARENT_ADDR_NAMESPACE);
34
35/// Lock for the execute entry point.
36pub const EXECUTE_LOCK: Item<bool> = Item::new(EXECUTE_LOCK_NAMESPACE);
37
38/// Operators of this contract.
39pub const OPERATORS: Item<Vec<Addr>> = Item::new(OPERATORS_NAMESPACE);