bag
Module0x0000…0002
- Move path
- 0x0000…0002::bag
- Functions
- 1010 public, 0 entry
- Structs
- 1
- Friend modules
- None
bag
- accumulator18
- accumulator_metadata2
- accumulator_settlement8
- address10
- address_alias5
- allowance40
- authenticator_state13
- bag10
- balance18
- bcs30
- bls1238143
- borrow4
- clock3
- coin54
- coin_registry43
- config11
- deny_list21
- derived_object3
- display14
- display_registry18
- dynamic_field19
- dynamic_object_field15
- ecdsa_k13
- ecdsa_r12
- ecvrf1
- ed255191
- event3
- forwarding_address1
- funds_accumulator12
- groth1610
- group_ops23
- hash2
- hex3
- hmac1
- kiosk41
- kiosk_extension14
- linked_table19
- math7
- nitro_attestation11
- object32
- object_bag11
- object_table10
- package26
- party5
- pay8
- poseidon2
- priority_queue8
- protocol_config1
- prover0
- random20
- rangeproofs3
- ristretto25518
- scratch18
- sui2
- table10
- table_vec12
- token45
- transfer16
- transfer_policy18
- tx_context19
- types1
- url4
- vdf4
- vec_map20
- vec_set11
- versioned7
- zklogin_verified_id9
- zklogin_verified_issuer6
Bytecode140 lines
The on-chain disassembly. Offsets are bytecode positions within each function.
// Move bytecode v7
module 2.bag {
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_field;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
struct Bag has store, key {
id: UID,
size: u64
}
public new(Arg0: &mut TxContext): Bag {
B0:
0MoveLoc[0](Arg0: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdU64(0)
3Pack[0](Bag)
4Ret
}
public add<Ty0: copy + drop + store, Ty1: store>(Arg0: &mut Bag, Arg1: Ty0, Arg2: Ty1) {
B0:
0CopyLoc[0](Arg0: &mut Bag)
1MutBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3MoveLoc[2](Arg2: Ty1)
4Call dynamic_field::add<Ty0, Ty1>(&mut UID, Ty0, Ty1)
5CopyLoc[0](Arg0: &mut Bag)
6ImmBorrowField[1](Bag.size: u64)
7ReadRef
8LdU64(1)
9Add
10MoveLoc[0](Arg0: &mut Bag)
11MutBorrowField[1](Bag.size: u64)
12WriteRef
13Ret
}
public borrow<Ty0: copy + drop + store, Ty1: store>(Arg0: &Bag, Arg1: Ty0): &Ty1 {
B0:
0MoveLoc[0](Arg0: &Bag)
1ImmBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3Call dynamic_field::borrow<Ty0, Ty1>(&UID, Ty0): &Ty1
4Ret
}
public borrow_mut<Ty0: copy + drop + store, Ty1: store>(Arg0: &mut Bag, Arg1: Ty0): &mut Ty1 {
B0:
0MoveLoc[0](Arg0: &mut Bag)
1MutBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3Call dynamic_field::borrow_mut<Ty0, Ty1>(&mut UID, Ty0): &mut Ty1
4Ret
}
public remove<Ty0: copy + drop + store, Ty1: store>(Arg0: &mut Bag, Arg1: Ty0): Ty1 {
L2: loc0: Ty1
B0:
0CopyLoc[0](Arg0: &mut Bag)
1MutBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3Call dynamic_field::remove<Ty0, Ty1>(&mut UID, Ty0): Ty1
4StLoc[2](loc0: Ty1)
5CopyLoc[0](Arg0: &mut Bag)
6ImmBorrowField[1](Bag.size: u64)
7ReadRef
8LdU64(1)
9Sub
10MoveLoc[0](Arg0: &mut Bag)
11MutBorrowField[1](Bag.size: u64)
12WriteRef
13MoveLoc[2](loc0: Ty1)
14Ret
}
public contains<Ty0: copy + drop + store>(Arg0: &Bag, Arg1: Ty0): bool {
B0:
0MoveLoc[0](Arg0: &Bag)
1ImmBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3Call dynamic_field::exists<Ty0>(&UID, Ty0): bool
4Ret
}
public contains_with_type<Ty0: copy + drop + store, Ty1: store>(Arg0: &Bag, Arg1: Ty0): bool {
B0:
0MoveLoc[0](Arg0: &Bag)
1ImmBorrowField[0](Bag.id: UID)
2MoveLoc[1](Arg1: Ty0)
3Call dynamic_field::exists_with_type<Ty0, Ty1>(&UID, Ty0): bool
4Ret
}
public length(Arg0: &Bag): u64 {
B0:
0MoveLoc[0](Arg0: &Bag)
1ImmBorrowField[1](Bag.size: u64)
2ReadRef
3Ret
}
public is_empty(Arg0: &Bag): bool {
B0:
0MoveLoc[0](Arg0: &Bag)
1ImmBorrowField[1](Bag.size: u64)
2ReadRef
3LdU64(0)
4Eq
5Ret
}
public destroy_empty(Arg0: Bag) {
L1: loc0: UID
L2: loc1: u64
B0:
0MoveLoc[0](Arg0: Bag)
1Unpack[0](Bag)
2StLoc[2](loc1: u64)
3StLoc[1](loc0: UID)
4MoveLoc[2](loc1: u64)
5LdU64(0)
6Eq
7BrFalse(9)
B1:
8Branch(11)
B2:
9LdConst[0](u64: 0)
10Abort
B3:
11MoveLoc[1](loc0: UID)
12Call object::delete(UID)
13Ret
}
Constants [
0 => u64: 0
]
}