Module sui::object
Sui object identifiers
- Struct ID
- Struct UID
- Constants
- Function id_to_bytes
- Function id_to_address
- Function id_from_bytes
- Function id_from_address
- Function sui_system_state
- Function clock
- Function authenticator_state
- Function randomness_state
- Function sui_deny_list_object_id
- Function sui_accumulator_root_object_id
- Function sui_accumulator_root_address
- Function sui_coin_registry_object_id
- Function sui_coin_registry_address
- Function bridge
- Function uid_as_inner
- Function uid_to_inner
- Function uid_to_bytes
- Function uid_to_address
- Function new
- Function delete
- Function id
- Function borrow_id
- Function id_bytes
- Function id_address
- Function borrow_uid
- Function new_uid_from_hash
- Function delete_impl
- Function record_new_uid
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
use sui::address;
use sui::hex;
use sui::tx_context;
Struct ID
An object ID. This is used to reference Sui Objects. This is not guaranteed to be globally unique--anyone can create an
ID from a UID or
from an object, and ID's can be freely copied and dropped.
Here, the values are not globally unique because there can be multiple values of type ID
with the same underlying bytes. For example, object::id(&obj) can be called as many times
as you want for a given obj, and each ID value will be identical.
public struct ID has copy, drop, store
Click to open
Fields
-
bytes: address
Struct UID
Globally unique IDs that define an object's ID in storage. Any Sui Object, that is a struct
with the key ability, must have
id: UID as its first field.
These are globally unique in the sense that no two values of type UID are ever equal, in
other words for any two values id1: UID and id2: UID, id1 != id2.
This is a privileged type that can only be derived from a TxContext.
UID doesn't have the drop ability, so deleting a UID requires a call to delete.
public struct UID has store
Click to open
Fields
Constants
The hardcoded ID for the singleton Sui System State Object.
const SUI_SYSTEM_STATE_OBJECT_ID: address = 0x5;
The hardcoded ID for the singleton Clock Object.
const SUI_CLOCK_OBJECT_ID: address = 0x6;
The hardcoded ID for the singleton AuthenticatorState Object.
const SUI_AUTHENTICATOR_STATE_ID: address = 0x7;
The hardcoded ID for the singleton Random Object.
const SUI_RANDOM_ID: address = 0x8;
The hardcoded ID for the singleton DenyList.
const SUI_DENY_LIST_OBJECT_ID: address = 0x403;
The hardcoded ID for the singleton AccumulatorRoot Object.
const SUI_ACCUMULATOR_ROOT_OBJECT_ID: address = 0xacc;
The hardcoded ID for the Bridge Object.
const SUI_BRIDGE_ID: address = 0x9;
The hardcoded ID for the Coin Registry Object.
const SUI_COIN_REGISTRY_OBJECT_ID: address = 0xc;
Sender is not @0x0 the system address.
const ENotSystemAddress: u64 = 0;