1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pub mod phronesis {
    use crate::Balance;

    // Provide a common factor between runtimes based on a supply of 10_000_000 tokens.
    pub const SUPPLY_FACTOR: Balance = 100;

    pub const WEI: Balance = 1;
    pub const KILOWEI: Balance = 1_000;
    pub const MEGAWEI: Balance = 1_000_000;
    pub const GIGAWEI: Balance = 1_000_000_000;
    pub const MICROPHRON: Balance = 1_000_000_000_000;
    pub const MILLIPHRON: Balance = 1_000_000_000_000_000;
    pub const PHRON: Balance = 1_000_000_000_000_000_000;
    pub const KILOPHRON: Balance = 1_000_000_000_000_000_000_000;

    pub const TRANSACTION_BYTE_FEE: Balance = GIGAWEI * SUPPLY_FACTOR;
    pub const STORAGE_BYTE_FEE: Balance = 100 * MICROPHRON * SUPPLY_FACTOR;
    pub const WEIGHT_FEE: Balance = 50 * KILOWEI * SUPPLY_FACTOR;

    pub const fn deposit(items: u32, bytes: u32) -> Balance {
        (items as Balance) * 100 * MILLIPHRON * SUPPLY_FACTOR + (bytes as Balance) * STORAGE_BYTE_FEE
    }
}