seedelf_cli/
constants.rs

1/// The current variant of seedelf
2pub const VARIANT: u64 = 1;
3
4pub struct Contract {
5    pub wallet_contract_hash: &'static str,
6    pub seedelf_policy_id: &'static str,
7    pub wallet_contract_size: u64,
8    pub seedelf_contract_size: u64,
9}
10
11pub struct Reference {
12    pub wallet_reference_utxo: &'static str,
13    pub seedelf_reference_utxo: &'static str,
14}
15
16pub struct Config {
17    pub contract: Contract,
18    pub reference: Reference,
19}
20
21/// We can store all variants of the contracts inside this function then call it whenever we need it.
22pub fn get_config(variant: u64, network: bool) -> Option<Config> {
23    match variant {
24        1 => {
25            let reference: Reference = if network {
26                Reference {
27                    wallet_reference_utxo: "96fbddac63c55284fbbaa3c216ef1c0f460019e8643a889a189d5b5f7ddd71d6",
28                    seedelf_reference_utxo: "f620a4e949bfbefbf2892d39d0777439f3acfbf850eae9b007c6558ba8ef4db4",
29                }
30            } else {
31                Reference {
32                    wallet_reference_utxo: "51f12c1a5c2b0558a284628d81b06dee50b27693242fe35618c5f921730c0527",
33                    seedelf_reference_utxo: "f3955f42f660fae8b3e4dcf664011876cf769d87aa8450dc73171b4f6b5f520b",
34                }
35            };
36            let contract: Contract = Contract {
37                wallet_contract_hash: "94bca9c099e84ffd90d150316bb44c31a78702239076a0a80ea4a469",
38                seedelf_policy_id: "84967d911e1a10d5b4a38441879f374a07f340945bcf9e7697485255",
39                wallet_contract_size: 629,
40                seedelf_contract_size: 519,
41            };
42            Some(Config {
43                contract,
44                reference,
45            })
46        }
47        _ => None, // unsupported variant
48    }
49}
50
51// support the [LOGIC] stakepool
52pub const PREPROD_STAKE_HASH: &str = "86c769419aaa673c963da04e4b5bae448d490e2ceac902cb82e4da76";
53pub const MAINNET_STAKE_HASH: &str = "fcfc7701b1df42061202efa9c96968a481bbd6a0676efb7afa87ebf1";
54
55// collateral info for giveme.my
56pub const COLLATERAL_HASH: &str = "7c24c22d1dc252d31f6022ff22ccc838c2ab83a461172d7c2dae61f4";
57pub const COLLATERAL_PUBLIC_KEY: &str =
58    "fa2025e788fae01ce10deffff386f992f62a311758819e4e3792887396c171ba";
59
60pub const PREPROD_COLLATERAL_UTXO: &str =
61    "1d388e615da2dca607e28f704130d04e39da6f251d551d66d054b75607e0393f";
62pub const MAINNET_COLLATERAL_UTXO: &str =
63    "e62351eacbdd001aee77a91805840d2b81f77feebbf2439fb01b79e76c42c839";
64
65// ADA Handle Policy Ids
66pub const ADA_HANDLE_POLICY_ID: &str = "f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a";
67
68// these maximums are estimated
69pub const MAXIMUM_WALLET_UTXOS: u64 = 20;
70pub const MAXIMUM_TOKENS_PER_UTXO: u64 = 20;
71
72// protocol parameters
73pub const OVERHEAD_COST: u64 = 160;
74pub const UTXO_COST_PER_BYTE: u64 = 4_310;
75
76pub const MEM_COST_NUMERATOR: u64 = 577;
77pub const MEM_COST_DENOMINATOR: u64 = 10_000;
78pub const CPU_COST_NUMERATOR: u64 = 721;
79pub const CPU_COST_DENOMINATOR: u64 = 10_000_000;
80
81pub fn plutus_v3_cost_model() -> Vec<i64> {
82    vec![
83        100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305, 8356, 4, 16000,
84        100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 100, 100, 16000, 100,
85        94375, 32, 132994, 32, 61462, 4, 72010, 178, 0, 1, 22151, 32, 91189, 769, 4, 2, 85848,
86        123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 1, 1000, 42921, 4, 2, 24548, 29498, 38, 1,
87        898148, 27279, 1, 51775, 558, 1, 39184, 1000, 60594, 1, 141895, 32, 83150, 32, 15299, 32,
88        76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541, 1,
89        33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 123203, 7305, -900,
90        1716, 549, 57, 85848, 0, 1, 90434, 519, 0, 1, 74433, 32, 85848, 123203, 7305, -900, 1716,
91        549, 57, 85848, 0, 1, 1, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 955506,
92        213312, 0, 2, 270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0, 141992, 32, 100788, 420,
93        1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744, 32, 25933, 32, 24623, 32,
94        43053543, 10, 53384111, 14333, 10, 43574283, 26308, 10, 16000, 100, 16000, 100, 962335, 18,
95        2780678, 6, 442008, 1, 52538055, 3756, 18, 267929, 18, 76433006, 8868, 18, 52948122, 18,
96        1995836, 36, 3227919, 12, 901022, 1, 166917843, 4307, 36, 284546, 36, 158221314, 26549, 36,
97        74698472, 36, 333849714, 1, 254006273, 72, 2174038, 72, 2261318, 64571, 4, 207616, 8310, 4,
98        1293828, 28716, 63, 0, 1, 1006041, 43623, 251, 0, 1, 100181, 726, 719, 0, 1, 100181, 726,
99        719, 0, 1, 100181, 726, 719, 0, 1, 107878, 680, 0, 1, 95336, 1, 281145, 18848, 0, 1,
100        180194, 159, 1, 1, 158519, 8942, 0, 1, 159378, 8813, 0, 1, 107490, 3298, 1, 106057, 655, 1,
101        1964219, 24520, 3,
102    ]
103}