1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::{Addr, Coin, Timestamp};
3use cw_storage_plus::Item;
4
5#[cw_serde]
6pub struct Config {
7 pub start_time: Timestamp,
8 pub end_time: Timestamp,
9 pub mint_price: Coin,
10 pub per_address_limit: u32,
11}
12
13#[cw_serde]
14pub struct AdminList {
15 pub admins: Vec<Addr>,
16 pub mutable: bool,
17}
18
19impl AdminList {
20 pub fn is_admin(&self, addr: impl AsRef<str>) -> bool {
21 let addr = addr.as_ref();
22 self.admins.iter().any(|a| a.as_ref() == addr)
23 }
24
25 pub fn can_modify(&self, addr: &str) -> bool {
26 self.mutable && self.is_admin(addr)
27 }
28}
29
30pub const ADMIN_LIST: Item<AdminList> = Item::new("admin_list");
31pub const CONFIG: Item<Config> = Item::new("config");
32pub const MERKLE_ROOT: Item<String> = Item::new("merkle_root");
33pub const MERKLE_TREE_URI: Item<String> = Item::new("merkle_tree_uri");