Search by name, SuiNS, address, digest, object ID, coin type or checkpoint.

API

object_box

Module0x40fc…5bb2
Move path
0xed6c…9f32::object_box
Functions
99 public, 0 entry
Structs
1
Friend modules
None
object_box

Bytecode152 lines

The on-chain disassembly. Offsets are bytecode positions within each function.

// Move bytecode v6
module ed6c6fe0732be937f4379bc0b471f0f6bfbe0e8741968009e0f01e6de3d59f32.object_box {
use 0000000000000000000000000000000000000000000000000000000000000001::type_name;
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_object_field;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
 
struct ObjectBox has store, key {
id: UID,
len: u64
}
 
public empty(Arg0: &mut TxContext): ObjectBox {
B0:
0MoveLoc[0](Arg0: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdU64(0)
3Pack[0](ObjectBox)
4Ret
}
 
public new<Ty0: store + key>(Arg0: Ty0, Arg1: &mut TxContext): ObjectBox {
L2: loc0: ObjectBox
B0:
0MoveLoc[1](Arg1: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdU64(0)
3Pack[0](ObjectBox)
4StLoc[2](loc0: ObjectBox)
5MutBorrowLoc[2](loc0: ObjectBox)
6MutBorrowField[0](ObjectBox.id: UID)
7Call type_name::get<Ty0>(): TypeName
8MoveLoc[0](Arg0: Ty0)
9Call dynamic_object_field::add<TypeName, Ty0>(&mut UID, TypeName, Ty0)
10LdU64(1)
11MutBorrowLoc[2](loc0: ObjectBox)
12MutBorrowField[1](ObjectBox.len: u64)
13WriteRef
14MoveLoc[2](loc0: ObjectBox)
15Ret
}
 
public has_object<Ty0: store + key>(Arg0: &ObjectBox): bool {
B0:
0MoveLoc[0](Arg0: &ObjectBox)
1ImmBorrowField[0](ObjectBox.id: UID)
2Call type_name::get<Ty0>(): TypeName
3Call dynamic_object_field::exists_<TypeName>(&UID, TypeName): bool
4Ret
}
 
public borrow<Ty0: store + key>(Arg0: &ObjectBox): &Ty0 {
B0:
0MoveLoc[0](Arg0: &ObjectBox)
1ImmBorrowField[0](ObjectBox.id: UID)
2Call type_name::get<Ty0>(): TypeName
3Call dynamic_object_field::borrow<TypeName, Ty0>(&UID, TypeName): &Ty0
4Ret
}
 
public borrow_mut<Ty0: store + key>(Arg0: &mut ObjectBox): &mut Ty0 {
B0:
0MoveLoc[0](Arg0: &mut ObjectBox)
1MutBorrowField[0](ObjectBox.id: UID)
2Call type_name::get<Ty0>(): TypeName
3Call dynamic_object_field::borrow_mut<TypeName, Ty0>(&mut UID, TypeName): &mut Ty0
4Ret
}
 
public add<Ty0: store + key>(Arg0: &mut ObjectBox, Arg1: Ty0) {
B0:
0CopyLoc[0](Arg0: &mut ObjectBox)
1ImmBorrowField[1](ObjectBox.len: u64)
2ReadRef
3LdU64(0)
4Eq
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut ObjectBox)
8Pop
9LdConst[0](u64: 0)
10Abort
B3:
11CopyLoc[0](Arg0: &mut ObjectBox)
12MutBorrowField[0](ObjectBox.id: UID)
13Call type_name::get<Ty0>(): TypeName
14MoveLoc[1](Arg1: Ty0)
15Call dynamic_object_field::add<TypeName, Ty0>(&mut UID, TypeName, Ty0)
16CopyLoc[0](Arg0: &mut ObjectBox)
17ImmBorrowField[1](ObjectBox.len: u64)
18ReadRef
19LdU64(1)
20Add
21MoveLoc[0](Arg0: &mut ObjectBox)
22MutBorrowField[1](ObjectBox.len: u64)
23WriteRef
24Ret
}
 
public remove<Ty0: store + key>(Arg0: &mut ObjectBox): Ty0 {
B0:
0CopyLoc[0](Arg0: &mut ObjectBox)
1ImmBorrowField[1](ObjectBox.len: u64)
2ReadRef
3LdU64(1)
4Sub
5CopyLoc[0](Arg0: &mut ObjectBox)
6MutBorrowField[1](ObjectBox.len: u64)
7WriteRef
8MoveLoc[0](Arg0: &mut ObjectBox)
9MutBorrowField[0](ObjectBox.id: UID)
10Call type_name::get<Ty0>(): TypeName
11Call dynamic_object_field::remove<TypeName, Ty0>(&mut UID, TypeName): Ty0
12Ret
}
 
public is_empty(Arg0: &ObjectBox): bool {
B0:
0MoveLoc[0](Arg0: &ObjectBox)
1ImmBorrowField[1](ObjectBox.len: u64)
2ReadRef
3LdU64(0)
4Eq
5Ret
}
 
public destroy(Arg0: ObjectBox) {
B0:
0ImmBorrowLoc[0](Arg0: ObjectBox)
1Call is_empty(&ObjectBox): bool
2BrFalse(4)
B1:
3Branch(6)
B2:
4LdConst[1](u64: 1)
5Abort
B3:
6MoveLoc[0](Arg0: ObjectBox)
7Unpack[0](ObjectBox)
8Pop
9Call object::delete(UID)
10Ret
}
 
Constants [
0 => u64: 0
1 => u64: 1
]
}