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

API

utils

Module0x69df…0ab4
Move path
0x69df…0ab4::utils
Functions
1010 public, 0 entry
Structs
0
Friend modules
None
utils

Bytecode378 lines

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

// Move bytecode v6
module 69dfb26296901888fb97624093da331c76f88d0bfa50bdfbcb27041ebba70ab4.utils {
use 69dfb26296901888fb97624093da331c76f88d0bfa50bdfbcb27041ebba70ab4::decimal;
use 0000000000000000000000000000000000000000000000000000000000000001::ascii;
use 0000000000000000000000000000000000000000000000000000000000000001::string;
use 0000000000000000000000000000000000000000000000000000000000000001::type_name;
 
public get_type<Ty0>(): String {
B0:
0Call type_name::get<Ty0>(): TypeName
1Call type_name::into_string(TypeName): String
2Call string::from_ascii(String): String
3Ret
}
 
public power(Arg0: u64, Arg1: u64): u64 {
L2: loc0: u64
L3: loc1: u64
B0:
0LdU64(1)
1StLoc[3](loc1: u64)
2LdU64(1)
3StLoc[2](loc0: u64)
B1:
4CopyLoc[2](loc0: u64)
5CopyLoc[1](Arg1: u64)
6Le
7BrFalse(18)
B2:
8Branch(9)
B3:
9MoveLoc[3](loc1: u64)
10CopyLoc[0](Arg0: u64)
11Mul
12StLoc[3](loc1: u64)
13MoveLoc[2](loc0: u64)
14LdU64(1)
15Add
16StLoc[2](loc0: u64)
17Branch(4)
B4:
18MoveLoc[3](loc1: u64)
19Ret
}
 
public vector_to_hex_char(Arg0: vector<u8>): String {
L1: loc0: &u8
L2: loc1: String
L3: loc2: u64
L4: loc3: u8
L5: loc4: String
L6: loc5: u8
L7: loc6: String
B0:
0LdU64(0)
1StLoc[3](loc2: u64)
2LdConst[4](vector<u8>: "0x"..)
3Call string::utf8(vector<u8>): String
4StLoc[2](loc1: String)
B1:
5CopyLoc[3](loc2: u64)
6ImmBorrowLoc[0](Arg0: vector<u8>)
7VecLen(5)
8Lt
9BrFalse(42)
B2:
10Branch(11)
B3:
11ImmBorrowLoc[0](Arg0: vector<u8>)
12CopyLoc[3](loc2: u64)
13VecImmBorrow(5)
14StLoc[1](loc0: &u8)
15CopyLoc[1](loc0: &u8)
16ReadRef
17LdU8(16)
18Div
19StLoc[4](loc3: u8)
20MoveLoc[1](loc0: &u8)
21ReadRef
22LdU8(16)
23Mod
24StLoc[6](loc5: u8)
25MoveLoc[4](loc3: u8)
26Call decimal_to_hex_char(u8): String
27StLoc[5](loc4: String)
28MoveLoc[6](loc5: u8)
29Call decimal_to_hex_char(u8): String
30StLoc[7](loc6: String)
31MutBorrowLoc[2](loc1: String)
32MoveLoc[5](loc4: String)
33Call string::append(&mut String, String)
34MutBorrowLoc[2](loc1: String)
35MoveLoc[7](loc6: String)
36Call string::append(&mut String, String)
37MoveLoc[3](loc2: u64)
38LdU64(1)
39Add
40StLoc[3](loc2: u64)
41Branch(5)
B4:
42MoveLoc[2](loc1: String)
43Ret
}
 
public vector_to_hex_char_without_prefix(Arg0: vector<u8>): String {
L1: loc0: &u8
L2: loc1: String
L3: loc2: u64
L4: loc3: u8
L5: loc4: String
L6: loc5: u8
L7: loc6: String
B0:
0LdU64(0)
1StLoc[3](loc2: u64)
2LdConst[5](vector<u8>: "" /..)
3Call string::utf8(vector<u8>): String
4StLoc[2](loc1: String)
B1:
5CopyLoc[3](loc2: u64)
6ImmBorrowLoc[0](Arg0: vector<u8>)
7VecLen(5)
8Lt
9BrFalse(42)
B2:
10Branch(11)
B3:
11ImmBorrowLoc[0](Arg0: vector<u8>)
12CopyLoc[3](loc2: u64)
13VecImmBorrow(5)
14StLoc[1](loc0: &u8)
15CopyLoc[1](loc0: &u8)
16ReadRef
17LdU8(16)
18Div
19StLoc[4](loc3: u8)
20MoveLoc[1](loc0: &u8)
21ReadRef
22LdU8(16)
23Mod
24StLoc[6](loc5: u8)
25MoveLoc[4](loc3: u8)
26Call decimal_to_hex_char(u8): String
27StLoc[5](loc4: String)
28MoveLoc[6](loc5: u8)
29Call decimal_to_hex_char(u8): String
30StLoc[7](loc6: String)
31MutBorrowLoc[2](loc1: String)
32MoveLoc[5](loc4: String)
33Call string::append(&mut String, String)
34MutBorrowLoc[2](loc1: String)
35MoveLoc[7](loc6: String)
36Call string::append(&mut String, String)
37MoveLoc[3](loc2: u64)
38LdU64(1)
39Add
40StLoc[3](loc2: u64)
41Branch(5)
B4:
42MoveLoc[2](loc1: String)
43Ret
}
 
public decimal_to_hex_char(Arg0: u8): String {
L1: loc0: vector<vector<u8>>
B0:
0LdConst[0](vector<vector<u8>>: 1001..)
1StLoc[1](loc0: vector<vector<u8>>)
2ImmBorrowLoc[1](loc0: vector<vector<u8>>)
3MoveLoc[0](Arg0: u8)
4CastU64
5VecImmBorrow(4)
6ReadRef
7Call string::utf8(vector<u8>): String
8Ret
}
 
public default_rate_factor_bps(): u64 {
B0:
0LdConst[1](u64: 10000)
1Ret
}
 
public approximate_compounded_interest(Arg0: Decimal, Arg1: u64): Decimal {
L2: loc0: Decimal
L3: loc1: Decimal
L4: loc2: Decimal
L5: loc3: u256
L6: loc4: u256
L7: loc5: u256
L8: loc6: Decimal
L9: loc7: Decimal
L10: loc8: Decimal
L11: loc9: Decimal
L12: loc10: Decimal
L13: loc11: Decimal
L14: loc12: Decimal
B0:
0MoveLoc[0](Arg0: Decimal)
1LdConst[2](u64: 3153..)
2Call decimal::from(u64): Decimal
3Call decimal::div(Decimal, Decimal): Decimal
4StLoc[2](loc0: Decimal)
5CopyLoc[1](Arg1: u64)
6LdU64(0)
7Eq
8BrFalse(11)
B1:
9Call decimal::one(): Decimal
10Ret
B2:
11CopyLoc[1](Arg1: u64)
12LdU64(1)
13Eq
14BrFalse(19)
B3:
15Call decimal::one(): Decimal
16MoveLoc[2](loc0: Decimal)
17Call decimal::add(Decimal, Decimal): Decimal
18Ret
B4:
19CopyLoc[1](Arg1: u64)
20LdU64(2)
21Eq
22BrFalse(31)
B5:
23Call decimal::one(): Decimal
24MoveLoc[2](loc0: Decimal)
25Call decimal::add(Decimal, Decimal): Decimal
26StLoc[12](loc10: Decimal)
27CopyLoc[12](loc10: Decimal)
28MoveLoc[12](loc10: Decimal)
29Call decimal::mul(Decimal, Decimal): Decimal
30Ret
B6:
31CopyLoc[1](Arg1: u64)
32LdU64(3)
33Eq
34BrFalse(45)
B7:
35Call decimal::one(): Decimal
36MoveLoc[2](loc0: Decimal)
37Call decimal::add(Decimal, Decimal): Decimal
38StLoc[13](loc11: Decimal)
39CopyLoc[13](loc11: Decimal)
40CopyLoc[13](loc11: Decimal)
41Call decimal::mul(Decimal, Decimal): Decimal
42MoveLoc[13](loc11: Decimal)
43Call decimal::mul(Decimal, Decimal): Decimal
44Ret
B8:
45CopyLoc[1](Arg1: u64)
46LdU64(4)
47Eq
48BrFalse(61)
B9:
49Call decimal::one(): Decimal
50MoveLoc[2](loc0: Decimal)
51Call decimal::add(Decimal, Decimal): Decimal
52StLoc[14](loc12: Decimal)
53CopyLoc[14](loc12: Decimal)
54MoveLoc[14](loc12: Decimal)
55Call decimal::mul(Decimal, Decimal): Decimal
56StLoc[9](loc7: Decimal)
57CopyLoc[9](loc7: Decimal)
58MoveLoc[9](loc7: Decimal)
59Call decimal::mul(Decimal, Decimal): Decimal
60Ret
B10:
61MoveLoc[1](Arg1: u64)
62CastU256
63StLoc[5](loc3: u256)
64CopyLoc[5](loc3: u256)
65LdU256(1)
66Sub
67StLoc[6](loc4: u256)
68CopyLoc[5](loc3: u256)
69LdU256(2)
70Sub
71StLoc[7](loc5: u256)
72CopyLoc[2](loc0: Decimal)
73CopyLoc[2](loc0: Decimal)
74Call decimal::mul(Decimal, Decimal): Decimal
75StLoc[4](loc2: Decimal)
76CopyLoc[4](loc2: Decimal)
77CopyLoc[2](loc0: Decimal)
78Call decimal::mul(Decimal, Decimal): Decimal
79StLoc[3](loc1: Decimal)
80MoveLoc[2](loc0: Decimal)
81CopyLoc[5](loc3: u256)
82Call decimal::mul_u256(Decimal, u256): Decimal
83StLoc[8](loc6: Decimal)
84MoveLoc[4](loc2: Decimal)
85CopyLoc[5](loc3: u256)
86CopyLoc[6](loc4: u256)
87Mul
88CastU128
89Call decimal::from_u128(u128): Decimal
90Call decimal::mul(Decimal, Decimal): Decimal
91LdU256(2)
92Call decimal::div_u256(Decimal, u256): Decimal
93StLoc[10](loc8: Decimal)
94MoveLoc[3](loc1: Decimal)
95MoveLoc[5](loc3: u256)
96MoveLoc[6](loc4: u256)
97Mul
98MoveLoc[7](loc5: u256)
99Mul
100CastU128
101Call decimal::from_u128(u128): Decimal
102Call decimal::mul(Decimal, Decimal): Decimal
103LdU256(6)
104Call decimal::div_u256(Decimal, u256): Decimal
105StLoc[11](loc9: Decimal)
106Call decimal::one(): Decimal
107MoveLoc[8](loc6: Decimal)
108Call decimal::add(Decimal, Decimal): Decimal
109MoveLoc[10](loc8: Decimal)
110Call decimal::add(Decimal, Decimal): Decimal
111MoveLoc[11](loc9: Decimal)
112Call decimal::add(Decimal, Decimal): Decimal
113Ret
}
 
public min_u64(Arg0: u64, Arg1: u64): u64 {
L2: loc0: u64
B0:
0CopyLoc[0](Arg0: u64)
1CopyLoc[1](Arg1: u64)
2Lt
3BrFalse(7)
B1:
4MoveLoc[0](Arg0: u64)
5StLoc[2](loc0: u64)
6Branch(9)
B2:
7MoveLoc[1](Arg1: u64)
8StLoc[2](loc0: u64)
B3:
9MoveLoc[2](loc0: u64)
10Ret
}
 
public max_u64(Arg0: u64, Arg1: u64): u64 {
L2: loc0: u64
B0:
0CopyLoc[0](Arg0: u64)
1CopyLoc[1](Arg1: u64)
2Gt
3BrFalse(7)
B1:
4MoveLoc[0](Arg0: u64)
5StLoc[2](loc0: u64)
6Branch(9)
B2:
7MoveLoc[1](Arg1: u64)
8StLoc[2](loc0: u64)
B3:
9MoveLoc[2](loc0: u64)
10Ret
}
 
public max_of_u64(): u64 {
B0:
0LdConst[3](u64: 1844..)
1Ret
}
 
Constants [
0 => vector<vector<u8>>: 100130013101320133013401350136013701380139016101620163016401650166
1 => u64: 10000
2 => u64: 31536000000
3 => u64: 18446744073709551615
4 => vector<u8>: "0x" // interpreted as UTF8 string
5 => vector<u8>: "" // interpreted as UTF8 string
]
}