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

interest

Module0x3466…98bb
Move path
0xce7f…4db2::interest
Functions
136 public, 0 entry
Structs
2
Friend modules
bottlebuckbucket
interest

Bytecode323 lines

The on-chain disassembly. Offsets are instruction numbers within each function.

// Move bytecode v7
module ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2.interest {
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::constants;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::math;
use 0000000000000000000000000000000000000000000000000000000000000002::clock;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
 
struct InterestTable has store, key {
id: UID,
interest_rate: u256,
active_interest_index: u256,
last_active_index_update: u64,
interest_payable: u256
}
 
struct BottleInterestIndex has store, key {
id: UID,
active_interest_index: u256
}
 
public(friend) new_interest_table(Arg0: &Clock, Arg1: &mut TxContext): InterestTable {
B0:
0MoveLoc[1](Arg1: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdU256(0)
3Call constants::interest_precision(): u256
4MoveLoc[0](Arg0: &Clock)
5Call clock::timestamp_ms(&Clock): u64
6LdU256(0)
7Pack[0](InterestTable)
8Ret
}
 
public(friend) new_bottle_interest_index(Arg0: u256, Arg1: &mut TxContext): BottleInterestIndex {
B0:
0MoveLoc[1](Arg1: &mut TxContext)
1Call object::new(&mut TxContext): UID
2MoveLoc[0](Arg0: u256)
3Pack[1](BottleInterestIndex)
4Ret
}
 
public(friend) set_interest_rate(Arg0: &mut InterestTable, Arg1: u256, Arg2: u64, Arg3: &Clock) {
B0:
0CopyLoc[1](Arg1: u256)
1CopyLoc[0](Arg0: &mut InterestTable)
2ImmBorrowField[0](InterestTable.interest_rate: u256)
3ReadRef
4Neq
5BrFalse(22)
B1:
6CopyLoc[0](Arg0: &mut InterestTable)
7MoveLoc[2](Arg2: u64)
8CopyLoc[3](Arg3: &Clock)
9Call accrue_active_interests(&mut InterestTable, u64, &Clock): u256 * u256
10Pop
11Pop
12MoveLoc[3](Arg3: &Clock)
13Call clock::timestamp_ms(&Clock): u64
14CopyLoc[0](Arg0: &mut InterestTable)
15MutBorrowField[1](InterestTable.last_active_index_update: u64)
16WriteRef
17MoveLoc[1](Arg1: u256)
18MoveLoc[0](Arg0: &mut InterestTable)
19MutBorrowField[0](InterestTable.interest_rate: u256)
20WriteRef
21Branch(26)
B2:
22MoveLoc[0](Arg0: &mut InterestTable)
23Pop
24MoveLoc[3](Arg3: &Clock)
25Pop
B3:
26Ret
}
 
public(friend) collect_interests(Arg0: &mut InterestTable): u64 {
L1: loc0: u256
B0:
0CopyLoc[0](Arg0: &mut InterestTable)
1ImmBorrowField[2](InterestTable.interest_payable: u256)
2ReadRef
3StLoc[1](loc0: u256)
4LdU256(0)
5MoveLoc[0](Arg0: &mut InterestTable)
6MutBorrowField[2](InterestTable.interest_payable: u256)
7WriteRef
8CopyLoc[1](loc0: u256)
9Call constants::max_u64(): u64
10CastU256
11Le
12BrFalse(14)
B1:
13Branch(16)
B2:
14LdConst[0](u64: 0)
15Abort
B3:
16MoveLoc[1](loc0: u256)
17CastU64
18Ret
}
 
public(friend) update_bottle_interest_index(Arg0: &mut BottleInterestIndex, Arg1: u256) {
B0:
0CopyLoc[0](Arg0: &mut BottleInterestIndex)
1ImmBorrowField[3](BottleInterestIndex.active_interest_index: u256)
2ReadRef
3CopyLoc[1](Arg1: u256)
4Lt
5BrFalse(11)
B1:
6MoveLoc[1](Arg1: u256)
7MoveLoc[0](Arg0: &mut BottleInterestIndex)
8MutBorrowField[3](BottleInterestIndex.active_interest_index: u256)
9WriteRef
10Branch(13)
B2:
11MoveLoc[0](Arg0: &mut BottleInterestIndex)
12Pop
B3:
13Ret
}
 
public(friend) accrue_active_interests(Arg0: &mut InterestTable, Arg1: u64, Arg2: &Clock): u256 * u256 {
L3: loc0: &Clock
L4: loc1: u256
L5: loc2: u256
L6: loc3: u256
B0:
0CopyLoc[0](Arg0: &mut InterestTable)
1CopyLoc[2](Arg2: &Clock)
2StLoc[3](loc0: &Clock)
3FreezeRef
4MoveLoc[3](loc0: &Clock)
5Call calculate_interest_index(&InterestTable, &Clock): u256 * u256
6StLoc[6](loc3: u256)
7StLoc[5](loc2: u256)
8LdU256(0)
9StLoc[4](loc1: u256)
10CopyLoc[6](loc3: u256)
11LdU256(0)
12Gt
13BrFalse(38)
B1:
14MoveLoc[1](Arg1: u64)
15CastU256
16MoveLoc[6](loc3: u256)
17Call constants::interest_precision(): u256
18Call math::mul_factor_u256(u256, u256, u256): u256
19StLoc[4](loc1: u256)
20CopyLoc[0](Arg0: &mut InterestTable)
21ImmBorrowField[2](InterestTable.interest_payable: u256)
22ReadRef
23CopyLoc[4](loc1: u256)
24Add
25CopyLoc[0](Arg0: &mut InterestTable)
26MutBorrowField[2](InterestTable.interest_payable: u256)
27WriteRef
28CopyLoc[5](loc2: u256)
29CopyLoc[0](Arg0: &mut InterestTable)
30MutBorrowField[4](InterestTable.active_interest_index: u256)
31WriteRef
32MoveLoc[2](Arg2: &Clock)
33Call clock::timestamp_ms(&Clock): u64
34MoveLoc[0](Arg0: &mut InterestTable)
35MutBorrowField[1](InterestTable.last_active_index_update: u64)
36WriteRef
37Branch(42)
B2:
38MoveLoc[0](Arg0: &mut InterestTable)
39Pop
40MoveLoc[2](Arg2: &Clock)
41Pop
B3:
42MoveLoc[5](loc2: u256)
43MoveLoc[4](loc1: u256)
44Ret
}
 
public(friend) calculate_interest_index(Arg0: &InterestTable, Arg1: &Clock): u256 * u256 {
L2: loc0: u256
L3: loc1: u256
L4: loc2: u256
L5: loc3: u64
B0:
0CopyLoc[0](Arg0: &InterestTable)
1ImmBorrowField[1](InterestTable.last_active_index_update: u64)
2ReadRef
3StLoc[5](loc3: u64)
4CopyLoc[1](Arg1: &Clock)
5Call clock::timestamp_ms(&Clock): u64
6CopyLoc[5](loc3: u64)
7Ge
8BrFalse(10)
B1:
9Branch(16)
B2:
10MoveLoc[0](Arg0: &InterestTable)
11Pop
12MoveLoc[1](Arg1: &Clock)
13Pop
14LdConst[1](u64: 1)
15Abort
B3:
16CopyLoc[1](Arg1: &Clock)
17Call clock::timestamp_ms(&Clock): u64
18CopyLoc[5](loc3: u64)
19Eq
20BrFalse(28)
B4:
21MoveLoc[1](Arg1: &Clock)
22Pop
23MoveLoc[0](Arg0: &InterestTable)
24ImmBorrowField[4](InterestTable.active_interest_index: u256)
25ReadRef
26LdU256(0)
27Ret
B5:
28CopyLoc[0](Arg0: &InterestTable)
29ImmBorrowField[0](InterestTable.interest_rate: u256)
30ReadRef
31StLoc[2](loc0: u256)
32MoveLoc[0](Arg0: &InterestTable)
33ImmBorrowField[4](InterestTable.active_interest_index: u256)
34ReadRef
35StLoc[3](loc1: u256)
36LdU256(0)
37StLoc[4](loc2: u256)
38CopyLoc[2](loc0: u256)
39LdU256(0)
40Gt
41BrFalse(58)
B6:
42MoveLoc[1](Arg1: &Clock)
43Call clock::timestamp_ms(&Clock): u64
44MoveLoc[5](loc3: u64)
45Sub
46CastU256
47MoveLoc[2](loc0: u256)
48Mul
49StLoc[4](loc2: u256)
50CopyLoc[3](loc1: u256)
51MoveLoc[3](loc1: u256)
52CopyLoc[4](loc2: u256)
53Call constants::interest_precision(): u256
54Call math::mul_factor_u256(u256, u256, u256): u256
55Add
56StLoc[3](loc1: u256)
57Branch(60)
B7:
58MoveLoc[1](Arg1: &Clock)
59Pop
B8:
60MoveLoc[3](loc1: u256)
61MoveLoc[4](loc2: u256)
62Ret
}
 
public get_interest_table_info(Arg0: &InterestTable): u256 * u256 * u64 * u256 {
B0:
0CopyLoc[0](Arg0: &InterestTable)
1ImmBorrowField[0](InterestTable.interest_rate: u256)
2ReadRef
3CopyLoc[0](Arg0: &InterestTable)
4ImmBorrowField[4](InterestTable.active_interest_index: u256)
5ReadRef
6CopyLoc[0](Arg0: &InterestTable)
7ImmBorrowField[1](InterestTable.last_active_index_update: u64)
8ReadRef
9MoveLoc[0](Arg0: &InterestTable)
10ImmBorrowField[2](InterestTable.interest_payable: u256)
11ReadRef
12Ret
}
 
public get_bottle_interest_index(Arg0: &BottleInterestIndex): u256 {
B0:
0MoveLoc[0](Arg0: &BottleInterestIndex)
1ImmBorrowField[3](BottleInterestIndex.active_interest_index: u256)
2ReadRef
3Ret
}
 
public get_interest_rate(Arg0: &InterestTable): u256 {
B0:
0MoveLoc[0](Arg0: &InterestTable)
1ImmBorrowField[0](InterestTable.interest_rate: u256)
2ReadRef
3Ret
}
 
public get_active_interest_index(Arg0: &InterestTable): u256 {
B0:
0MoveLoc[0](Arg0: &InterestTable)
1ImmBorrowField[4](InterestTable.active_interest_index: u256)
2ReadRef
3Ret
}
 
public get_last_active_index_update(Arg0: &InterestTable): u64 {
B0:
0MoveLoc[0](Arg0: &InterestTable)
1ImmBorrowField[1](InterestTable.last_active_index_update: u64)
2ReadRef
3Ret
}
 
public get_interest_payable(Arg0: &InterestTable): u256 {
B0:
0MoveLoc[0](Arg0: &InterestTable)
1ImmBorrowField[2](InterestTable.interest_payable: u256)
2ReadRef
3Ret
}
 
Constants [
0 => u64: 0
1 => u64: 1
]
}