- Resource
ChainID
- Constants
- Function
genesis_init
- Function
id
- Function
borrow
- Function
chain_id
- Function
is_local
- Function
is_dev
- Function
is_test
- Function
is_main
use 0x2::context;
use 0x2::object;
The ChainID in the global storage
struct ChainID has store, key
const CHAIN_ID_DEV: u64 = 20230103;
const CHAIN_ID_LOCAL: u64 = 20230104;
const CHAIN_ID_MAIN: u64 = 20230101;
const CHAIN_ID_TEST: u64 = 20230102;
public(friend) fun genesis_init(ctx: &mut context::Context, _genesis_account: &signer, chain_id: u64)
public fun id(self: &chain_id::ChainID): u64
public fun borrow(ctx: &context::Context): &chain_id::ChainID
public fun chain_id(ctx: &context::Context): u64
public fun is_local(ctx: &context::Context): bool
public fun is_dev(ctx: &context::Context): bool
public fun is_test(ctx: &context::Context): bool
public fun is_main(ctx: &context::Context): bool