whitelist_immutable/
state.rs1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::{Addr, Decimal, Uint128};
3use cw_storage_plus::{Item, Map};
4
5#[cw_serde]
6pub struct Config {
7 pub admin: Addr,
8 pub per_address_limit: u32,
9 pub mint_discount_bps: Option<u64>,
10}
11
12impl Config {
13 pub fn mint_discount(&self) -> Option<Decimal> {
14 self.mint_discount_bps
15 .map(|v| Decimal::percent(v) / Uint128::from(100u128))
16 }
17}
18
19pub const CONFIG: Item<Config> = Item::new("config");
20pub const TOTAL_ADDRESS_COUNT: Item<u64> = Item::new("total_address_count");
21pub const WHITELIST: Map<&str, bool> = Map::new("wl");