Skip to main content

komple_framework_hub_module/
state.rs

1use cosmwasm_schema::cw_serde;
2use komple_framework_types::shared::{CONFIG_NAMESPACE, OPERATORS_NAMESPACE};
3
4use cosmwasm_std::Addr;
5use cw_storage_plus::{Item, Map};
6use komple_framework_types::modules::hub::{
7    HUB_INFO_NAMESPACE, MARBU_FEE_MODULE_NAMESPACE, MODULE_ID_NAMESPACE,
8    MODULE_TO_REGISTER_NAMESPACE,
9};
10use komple_framework_types::modules::MODULES_NAMESPACE;
11
12/// General information about the hub module.
13/// This information is equal to project information.
14#[cw_serde]
15pub struct HubInfo {
16    pub name: String,
17    pub description: String,
18    pub image: String,
19    pub external_link: Option<String>,
20}
21pub const HUB_INFO: Item<HubInfo> = Item::new(HUB_INFO_NAMESPACE);
22
23#[cw_serde]
24pub struct Config {
25    pub admin: Addr,
26}
27pub const CONFIG: Item<Config> = Item::new(CONFIG_NAMESPACE);
28
29/// Addresses of the registered modules.
30pub const MODULES: Map<String, Addr> = Map::new(MODULES_NAMESPACE);
31
32/// Operators of this contract.
33pub const OPERATORS: Item<Vec<Addr>> = Item::new(OPERATORS_NAMESPACE);
34
35/// ID used for the module registration purposes.
36pub const MODULE_ID: Item<u64> = Item::new(MODULE_ID_NAMESPACE);
37
38/// Module name to register. This is utilized in the reply handler of this contract.
39pub const MODULE_TO_REGISTER: Item<String> = Item::new(MODULE_TO_REGISTER_NAMESPACE);
40
41/// Fee module address if hub is created through Marbu.
42pub const MARBU_FEE_MODULE: Item<Addr> = Item::new(MARBU_FEE_MODULE_NAMESPACE);