oasis_runtime_sdk/modules/rofl/
config.rs

1use crate::types::token;
2
3/// Module configuration.
4pub trait Config: 'static {
5    /// Gas cost of rofl.Create call.
6    const GAS_COST_CALL_CREATE: u64 = 100_000;
7    /// Gas cost of rofl.Update call.
8    const GAS_COST_CALL_UPDATE: u64 = 100_000;
9    /// Gas cost of rofl.Remove call.
10    const GAS_COST_CALL_REMOVE: u64 = 10_000;
11    /// Gas cost of rofl.Register call.
12    const GAS_COST_CALL_REGISTER: u64 = 100_000;
13    /// Gas cost of rofl.IsAuthorizedOrigin call.
14    const GAS_COST_CALL_IS_AUTHORIZED_ORIGIN: u64 = 1000;
15    /// Gas cost of rofl.AuthorizedOriginNode call.
16    const GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE: u64 = 2000;
17    /// Gas cost of rofl.AuthorizedOriginEntity call.
18    const GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY: u64 = 2000;
19    /// Gas cost of rofl.StakeThresholds call.
20    const GAS_COST_CALL_STAKE_THRESHOLDS: u64 = 10;
21    /// Gas cost of rofl.DeriveKey call.
22    const GAS_COST_CALL_DERIVE_KEY: u64 = 10_000;
23
24    /// Maximum number of metadata key-value pairs.
25    const MAX_METADATA_PAIRS: usize = 64;
26    /// Maximum metadata key size.
27    const MAX_METADATA_KEY_SIZE: usize = 1024;
28    /// Maximum metadata value size.
29    const MAX_METADATA_VALUE_SIZE: usize = 16 * 1024;
30
31    /// Amount of stake required for maintaining an application.
32    ///
33    /// The stake is held in escrow and is returned to the administrator when the application is
34    /// removed.
35    const STAKE_APP_CREATE: token::BaseUnits =
36        token::BaseUnits::new(0, token::Denomination::NATIVE);
37
38    /// Maximum key identifier length for rofl.DeriveKey call.
39    const DERIVE_KEY_MAX_KEY_ID_LENGTH: usize = 128;
40}