Sui Framework
borrow
- Move path
- 0x0000…0002::borrow
- Functions
- 44 public, 0 entry
- Structs
- 2
- Friend modules
- None
borrow
- 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
Bytecode106 lines
The on-chain disassembly. Offsets are instruction numbers within each function.
// Move bytecode v7
module 2.borrow {
use 0000000000000000000000000000000000000000000000000000000000000001::option;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
struct Referent<Ty0: store + key> has store {
id: address,
value: Option<Ty0>
}
struct Borrow {
ref: address,
obj: ID
}
public new<Ty0: store + key>(Arg0: Ty0, Arg1: &mut TxContext): Referent<Ty0> {
B0:
0MoveLoc[1](Arg1: &mut TxContext)
1Call tx_context::fresh_object_address(&mut TxContext): address
2MoveLoc[0](Arg0: Ty0)
3Call option::some<Ty0>(Ty0): Option<Ty0>
4PackGeneric[0](Referent<Ty0>)
5Ret
}
public borrow<Ty0: store + key>(Arg0: &mut Referent<Ty0>): Ty0 * Borrow {
L1: loc0: ID
L2: loc1: Ty0
B0:
0CopyLoc[0](Arg0: &mut Referent<Ty0>)
1MutBorrowFieldGeneric[0](Referent.value: Option<Ty0>)
2Call option::extract<Ty0>(&mut Option<Ty0>): Ty0
3StLoc[2](loc1: Ty0)
4ImmBorrowLoc[2](loc1: Ty0)
5Call object::id<Ty0>(&Ty0): ID
6StLoc[1](loc0: ID)
7MoveLoc[2](loc1: Ty0)
8MoveLoc[0](Arg0: &mut Referent<Ty0>)
9ImmBorrowFieldGeneric[1](Referent.id: address)
10ReadRef
11MoveLoc[1](loc0: ID)
12Pack[1](Borrow)
13Ret
}
public put_back<Ty0: store + key>(Arg0: &mut Referent<Ty0>, Arg1: Ty0, Arg2: Borrow) {
L3: loc0: ID
L4: loc1: address
B0:
0MoveLoc[2](Arg2: Borrow)
1Unpack[1](Borrow)
2StLoc[3](loc0: ID)
3StLoc[4](loc1: address)
4ImmBorrowLoc[1](Arg1: Ty0)
5Call object::id<Ty0>(&Ty0): ID
6MoveLoc[3](loc0: ID)
7Eq
8BrFalse(10)
B1:
9Branch(14)
B2:
10MoveLoc[0](Arg0: &mut Referent<Ty0>)
11Pop
12LdConst[1](u64: 1)
13Abort
B3:
14CopyLoc[0](Arg0: &mut Referent<Ty0>)
15ImmBorrowFieldGeneric[1](Referent.id: address)
16ReadRef
17MoveLoc[4](loc1: address)
18Eq
19BrFalse(21)
B4:
20Branch(25)
B5:
21MoveLoc[0](Arg0: &mut Referent<Ty0>)
22Pop
23LdConst[0](u64: 0)
24Abort
B6:
25MoveLoc[0](Arg0: &mut Referent<Ty0>)
26MutBorrowFieldGeneric[0](Referent.value: Option<Ty0>)
27MoveLoc[1](Arg1: Ty0)
28Call option::fill<Ty0>(&mut Option<Ty0>, Ty0)
29Ret
}
public destroy<Ty0: store + key>(Arg0: Referent<Ty0>): Ty0 {
L1: loc0: Option<Ty0>
B0:
0MoveLoc[0](Arg0: Referent<Ty0>)
1UnpackGeneric[0](Referent<Ty0>)
2StLoc[1](loc0: Option<Ty0>)
3Pop
4MoveLoc[1](loc0: Option<Ty0>)
5Call option::destroy_some<Ty0>(Option<Ty0>): Ty0
6Ret
}
Constants [
0 => u64: 0
1 => u64: 1
]
}