dao_interface/token.rs
1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::Uint128;
3
4// These are Cosmos Proto types used for Denom Metadata.
5// We re-export them here for convenience.
6pub use osmosis_std::types::cosmos::bank::v1beta1::{DenomUnit, Metadata};
7
8use crate::state::ModuleInstantiateCallback;
9
10#[cw_serde]
11pub struct InitialBalance {
12 pub amount: Uint128,
13 pub address: String,
14}
15
16#[cw_serde]
17pub struct NewDenomMetadata {
18 /// The name of the token (e.g. "Cat Coin")
19 pub name: String,
20 /// The description of the token
21 pub description: String,
22 /// The ticker symbol of the token (e.g. "CAT")
23 pub symbol: String,
24 /// The unit commonly used in communication (e.g. "cat")
25 pub display: String,
26 /// Used define additional units of the token (e.g. "tiger")
27 /// These must have an exponent larger than 0.
28 pub additional_denom_units: Option<Vec<DenomUnit>>,
29}
30
31#[cw_serde]
32pub struct NewTokenInfo {
33 /// The code id of the cw-tokenfactory-issuer contract
34 pub token_issuer_code_id: u64,
35 /// The subdenom of the token to create, will also be used as an alias
36 /// for the denom. The Token Factory denom will have the format of
37 /// factory/{contract_address}/{subdenom}
38 pub subdenom: String,
39 /// Optional metadata for the token, this can additionally be set later.
40 pub metadata: Option<NewDenomMetadata>,
41 /// The initial balances to set for the token, cannot be empty.
42 pub initial_balances: Vec<InitialBalance>,
43 /// Optional balance to mint for the DAO.
44 pub initial_dao_balance: Option<Uint128>,
45}
46
47#[cw_serde]
48pub struct TokenFactoryCallback {
49 pub denom: String,
50 pub token_contract: Option<String>,
51 pub module_instantiate_callback: Option<ModuleInstantiateCallback>,
52}