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

Move path
0x0000…0002::borrow
Functions
44 public, 0 entry
Structs
2
Friend modules
None
borrow

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
]
}