odra_modules/cep18/
utils.rs1#[odra::odra_type]
3pub enum SecurityBadge {
4 Admin = 0,
6 Minter = 1,
8 None = 2
10}
11
12impl SecurityBadge {
13 pub fn can_admin(&self) -> bool {
15 matches!(self, SecurityBadge::Admin)
16 }
17
18 pub fn can_mint(&self) -> bool {
20 matches!(self, SecurityBadge::Minter | SecurityBadge::Admin)
21 }
22}
23#[derive(Default)]
25#[odra::odra_type]
26pub enum Cep18Modality {
27 #[default]
29 None = 0,
30 MintAndBurn = 1
32}
33
34impl Cep18Modality {
35 pub fn mint_and_burn_enabled(&self) -> bool {
37 matches!(self, Cep18Modality::MintAndBurn)
38 }
39}
40
41impl From<Cep18Modality> for u8 {
43 fn from(modality: Cep18Modality) -> u8 {
44 modality as u8
45 }
46}