1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use crateCyclesTokens;
use Principal;
use ;
// Specifies the transaction fee for ICP transactions.
pub const IC_TRANSACTION_FEE_ICP: Tokens = from_e8s;
// Specifies the transaction fee for Cycles ledger transactions.
pub const IC_TRANSACTION_FEE_CYCLES: CyclesTokens = from_e12s;
// Creating a canister require cycles. Those vary according to the subnet size (number of nodes).
// Check [Gas and cycles cost](https://internetcomputer.org/docs/current/developer-docs/gas-cost) for more details.
// Cost for creating a canister have been increased by 400% in November 2024:
// - https://forum.dfinity.org/t/evaluating-compute-pricing-in-response-to-increased-demand-on-the-internet-computer-protocol/36565
// - https://nns.ic0.app/proposal/?u=qoctq-giaaa-aaaaa-aaaea-cai&proposal=134032
pub const IC_CREATE_CANISTER_CYCLES: u128 = 500_000_000_000u128;
// Additional cycles allocated for creating different types of canisters to ensure operation beyond the minimum requirement.
pub const CREATE_SATELLITE_CYCLES: u128 = 1_000_000_000_000;
pub const CREATE_MISSION_CONTROL_CYCLES: u128 = 1_000_000_000_000;
pub const CREATE_ORBITER_CYCLES: u128 = 1_000_000_000_000;
// Reverse (CREA -> AERC) -> ASCII -> HEX -> LittleEndian
// NNS canister create: CREA 0x41455243
// NNS canister topup: CREA 0x50555054
// SAT -> TAS = 0x544153
// let reversed: Vec<char> = "CREA".chars().rev().collect();
// * for c in reversed {
// * println!("{:#x}", c as u32);
// * }
// Memos for different operations, encoded from specific ASCII strings to hexadecimal values.
pub const MEMO_CANISTER_CREATE: Memo = Memo; // == 'CREA'
pub const MEMO_CANISTER_APPROVE: Memo = Memo; // == 'APRO'
// Note: For topup, it has to be exactly the memo used by the IC
pub const MEMO_CANISTER_TOP_UP: Memo = Memo; // == 'TPUP'
pub const MEMO_SATELLITE_CREATE_REFUND: Memo = Memo; // == 'SATREFD'
pub const MEMO_ORBITER_CREATE_REFUND: Memo = Memo; // == 'ORBREFD'
// 10 controllers max on the IC - the canister itself and user of the console because these two are not added to the mission control state controllers
pub const MAX_NUMBER_OF_MISSION_CONTROL_ADMIN_CONTROLLERS: usize = 8;
// 10 controllers max on the IC. User and mission control principals are copied in satellite state controllers
pub const MAX_NUMBER_OF_ADMIN_CONTROLLERS: usize = 10;
// 20 editor or submit access keys. We defined this value to prevent stacking way too way identities.
pub const MAX_NUMBER_OF_ACCESS_KEYS: usize = 20;
// Useful for filtering stable tree map ranges that use Principal in keys
pub const PRINCIPAL_MIN: Principal = from_slice;
pub const PRINCIPAL_MAX: Principal = from_slice;