bucket
Module0x3466…98bb
- Move path
- 0xce7f…4db2::bucket
- Functions
- 7039 public, 0 entry
- Structs
- 5
- Friend modules
- buck
bucket
Bytecode2858 lines
The on-chain disassembly. Offsets are instruction numbers within each function.
// Move bytecode v7
module ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2.bucket {
use 00db9a10bb9536ab367b7d1ffa404c1d6c55f009076df1139dc108dd86608bbe::linked_table;
use 00db9a10bb9536ab367b7d1ffa404c1d6c55f009076df1139dc108dd86608bbe::math;
use f145ee6d09aae034924f80672bc76db2415dfd1b1bed863ac289af9d94e2c4fc::bucket_oracle;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bottle;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bucket_events;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::constants;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::interest;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::math as 0math;
use ce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::strap;
use 0000000000000000000000000000000000000000000000000000000000000001::option;
use 0000000000000000000000000000000000000000000000000000000000000001::u64;
use 0000000000000000000000000000000000000000000000000000000000000002::balance;
use 0000000000000000000000000000000000000000000000000000000000000002::clock;
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_field;
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_object_field;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::table;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
struct Bucket<phantom Ty0> has store, key {
id: UID,
min_collateral_ratio: u64,
recovery_mode_threshold: u64,
collateral_decimal: u8,
max_mint_amount: Option<u64>,
collateral_vault: Balance<Ty0>,
bottle_table: BottleTable,
surplus_bottle_table: Table<address, Bottle>,
minted_buck_amount: u64,
base_fee_rate: u64,
latest_redemption_time: u64,
total_flash_loan_amount: u64
}
struct PendingRecord has store, key {
id: UID,
bucket_pending_debt: u64,
bucket_pending_collateral: u64
}
struct FlashReceipt<phantom Ty0> {
amount: u64,
fee: u64
}
struct OutputKey has copy, drop, store {
dummy_field: bool
}
struct OutputVolume has store {
volume: u64
}
public(friend) new<Ty0>(Arg0: u64, Arg1: u64, Arg2: u8, Arg3: Option<u64>, Arg4: &mut TxContext): Bucket<Ty0> {
L5: loc0: UID
B0:
0CopyLoc[4](Arg4: &mut TxContext)
1Call object::new(&mut TxContext): UID
2StLoc[5](loc0: UID)
3MutBorrowLoc[5](loc0: UID)
4LdConst[9](vector<u8>: "pen..)
5CopyLoc[4](Arg4: &mut TxContext)
6Call new_pending_record(&mut TxContext): PendingRecord
7Call dynamic_object_field::add<vector<u8>, PendingRecord>(&mut UID, vector<u8>, PendingRecord)
8MoveLoc[5](loc0: UID)
9MoveLoc[0](Arg0: u64)
10MoveLoc[1](Arg1: u64)
11MoveLoc[2](Arg2: u8)
12MoveLoc[3](Arg3: Option<u64>)
13Call balance::zero<Ty0>(): Balance<Ty0>
14CopyLoc[4](Arg4: &mut TxContext)
15Call bottle::new_table(&mut TxContext): BottleTable
16MoveLoc[4](Arg4: &mut TxContext)
17Call table::new<address, Bottle>(&mut TxContext): Table<address, Bottle>
18LdU64(0)
19LdU64(0)
20LdU64(0)
21LdU64(0)
22PackGeneric[0](Bucket<Ty0>)
23Ret
}
public(friend) new_pending_record(Arg0: &mut TxContext): PendingRecord {
B0:
0MoveLoc[0](Arg0: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdU64(0)
3LdU64(0)
4Pack[1](PendingRecord)
5Ret
}
public(friend) add_pending_record_to_bucket<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: &mut TxContext) {
L2: loc0: vector<u8>
B0:
0LdConst[9](vector<u8>: "pen..)
1StLoc[2](loc0: vector<u8>)
2CopyLoc[0](Arg0: &mut Bucket<Ty0>)
3ImmBorrowFieldGeneric[0](Bucket.id: UID)
4CopyLoc[2](loc0: vector<u8>)
5Call dynamic_object_field::exists_with_type<vector<u8>, PendingRecord>(&UID, vector<u8>): bool
6Not
7BrFalse(15)
B1:
8MoveLoc[0](Arg0: &mut Bucket<Ty0>)
9MutBorrowFieldGeneric[0](Bucket.id: UID)
10MoveLoc[2](loc0: vector<u8>)
11MoveLoc[1](Arg1: &mut TxContext)
12Call new_pending_record(&mut TxContext): PendingRecord
13Call dynamic_object_field::add<vector<u8>, PendingRecord>(&mut UID, vector<u8>, PendingRecord)
14Branch(19)
B2:
15MoveLoc[1](Arg1: &mut TxContext)
16Pop
17MoveLoc[0](Arg0: &mut Bucket<Ty0>)
18Pop
B3:
19Ret
}
public(friend) add_interest_table_to_bucket<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: &Clock, Arg2: &mut TxContext) {
B0:
0MoveLoc[0](Arg0: &mut Bucket<Ty0>)
1MutBorrowFieldGeneric[0](Bucket.id: UID)
2LdConst[10](vector<u8>: "int..)
3MoveLoc[1](Arg1: &Clock)
4MoveLoc[2](Arg2: &mut TxContext)
5Call interest::new_interest_table(&Clock, &mut TxContext): InterestTable
6Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
7Ret
}
public(friend) add_interest_index_to_bottle(Arg0: &mut Bottle, Arg1: u256, Arg2: &mut TxContext) {
B0:
0MoveLoc[0](Arg0: &mut Bottle)
1MoveLoc[1](Arg1: u256)
2MoveLoc[2](Arg2: &mut TxContext)
3Call bottle::add_interest_index_to_bottle(&mut Bottle, u256, &mut TxContext)
4Ret
}
public(friend) add_interest_index_to_bottle_by_debtor<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: u256, Arg3: &mut TxContext) {
B0:
0MoveLoc[0](Arg0: &mut Bucket<Ty0>)
1MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2MoveLoc[1](Arg1: address)
3Call bottle::borrow_bottle_mut(&mut BottleTable, address): &mut Bottle
4MoveLoc[2](Arg2: u256)
5MoveLoc[3](Arg3: &mut TxContext)
6Call bottle::add_interest_index_to_bottle(&mut Bottle, u256, &mut TxContext)
7Ret
}
public borrow_interest_table<Ty0>(Arg0: &Bucket<Ty0>): &InterestTable {
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
2BrFalse(4)
B1:
3Branch(8)
B2:
4MoveLoc[0](Arg0: &Bucket<Ty0>)
5Pop
6LdConst[7](u64: 7)
7Abort
B3:
8MoveLoc[0](Arg0: &Bucket<Ty0>)
9ImmBorrowFieldGeneric[0](Bucket.id: UID)
10LdConst[10](vector<u8>: "int..)
11Call dynamic_object_field::borrow<vector<u8>, InterestTable>(&UID, vector<u8>): &InterestTable
12Ret
}
public(friend) borrow_interest_table_mut<Ty0>(Arg0: &mut Bucket<Ty0>): &mut InterestTable {
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
3BrFalse(5)
B1:
4Branch(9)
B2:
5MoveLoc[0](Arg0: &mut Bucket<Ty0>)
6Pop
7LdConst[7](u64: 7)
8Abort
B3:
9MoveLoc[0](Arg0: &mut Bucket<Ty0>)
10MutBorrowFieldGeneric[0](Bucket.id: UID)
11LdConst[10](vector<u8>: "int..)
12Call dynamic_object_field::borrow_mut<vector<u8>, InterestTable>(&mut UID, vector<u8>): &mut InterestTable
13Ret
}
public(friend) accrue_interests_by_debtor<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: &Clock): u64 {
L3: loc0: u64
L4: loc1: u64
L5: loc2: u256
L6: loc3: u64
L7: loc4: &Bottle
L8: loc5: u64
L9: loc6: u256
L10: loc7: u256
L11: loc8: u64
L12: loc9: u256
L13: loc10: u256
L14: loc11: &mut InterestTable
L15: loc12: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
2ReadRef
3StLoc[15](loc12: u64)
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5FreezeRef
6Call borrow_pending_record<Ty0>(&Bucket<Ty0>): &PendingRecord
7ImmBorrowField[3](PendingRecord.bucket_pending_debt: u64)
8ReadRef
9StLoc[11](loc8: u64)
10CopyLoc[0](Arg0: &mut Bucket<Ty0>)
11ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
12CopyLoc[1](Arg1: address)
13Call bottle::get_bottle_raw_info_by_debator(&BottleTable, address): u64 * u64
14StLoc[8](loc5: u64)
15Pop
16CopyLoc[0](Arg0: &mut Bucket<Ty0>)
17ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
18CopyLoc[1](Arg1: address)
19Call bottle::borrow_bottle(&BottleTable, address): &Bottle
20StLoc[7](loc4: &Bottle)
21CopyLoc[7](loc4: &Bottle)
22Call bottle::is_interest_index_exists(&Bottle): bool
23BrFalse(112)
B1:
24MoveLoc[7](loc4: &Bottle)
25Call bottle::borrow_interest_index(&Bottle): &BottleInterestIndex
26Call interest::get_bottle_interest_index(&BottleInterestIndex): u256
27StLoc[9](loc6: u256)
28CopyLoc[0](Arg0: &mut Bucket<Ty0>)
29Call borrow_interest_table_mut<Ty0>(&mut Bucket<Ty0>): &mut InterestTable
30StLoc[14](loc11: &mut InterestTable)
31CopyLoc[15](loc12: u64)
32CopyLoc[11](loc8: u64)
33Ge
34BrFalse(40)
B2:
35MoveLoc[15](loc12: u64)
36MoveLoc[11](loc8: u64)
37Sub
38StLoc[3](loc0: u64)
39Branch(42)
B3:
40LdU64(0)
41StLoc[3](loc0: u64)
B4:
42MoveLoc[3](loc0: u64)
43StLoc[6](loc3: u64)
44CopyLoc[14](loc11: &mut InterestTable)
45MoveLoc[6](loc3: u64)
46MoveLoc[2](Arg2: &Clock)
47Call interest::accrue_active_interests(&mut InterestTable, u64, &Clock): u256 * u256
48StLoc[10](loc7: u256)
49StLoc[12](loc9: u256)
50CopyLoc[9](loc6: u256)
51CopyLoc[12](loc9: u256)
52Lt
53BrFalse(87)
B5:
54MoveLoc[8](loc5: u64)
55CastU256
56MoveLoc[12](loc9: u256)
57MoveLoc[9](loc6: u256)
58Call 0math::mul_factor_u256(u256, u256, u256): u256
59StLoc[13](loc10: u256)
60CopyLoc[13](loc10: u256)
61Call constants::max_u64(): u64
62CastU256
63Le
64BrFalse(66)
B6:
65Branch(72)
B7:
66MoveLoc[14](loc11: &mut InterestTable)
67Pop
68MoveLoc[0](Arg0: &mut Bucket<Ty0>)
69Pop
70LdConst[8](u64: 8)
71Abort
B8:
72MoveLoc[13](loc10: u256)
73CastU64
74StLoc[8](loc5: u64)
75MoveLoc[14](loc11: &mut InterestTable)
76FreezeRef
77Call interest::get_active_interest_index(&InterestTable): u256
78StLoc[5](loc2: u256)
79CopyLoc[0](Arg0: &mut Bucket<Ty0>)
80MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
81MoveLoc[1](Arg1: address)
82Call bottle::borrow_bottle_mut(&mut BottleTable, address): &mut Bottle
83MoveLoc[8](loc5: u64)
84MoveLoc[5](loc2: u256)
85Call bottle::update_bottle_debt_and_interest_index(&mut Bottle, u64, u256)
86Branch(89)
B9:
87MoveLoc[14](loc11: &mut InterestTable)
88Pop
B10:
89CopyLoc[10](loc7: u256)
90Call constants::max_u64(): u64
91CastU256
92Le
93BrFalse(95)
B11:
94Branch(99)
B12:
95MoveLoc[0](Arg0: &mut Bucket<Ty0>)
96Pop
97LdConst[8](u64: 8)
98Abort
B13:
99CopyLoc[0](Arg0: &mut Bucket<Ty0>)
100ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
101ReadRef
102CopyLoc[10](loc7: u256)
103CastU64
104Add
105MoveLoc[0](Arg0: &mut Bucket<Ty0>)
106MutBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
107WriteRef
108MoveLoc[10](loc7: u256)
109CastU64
110StLoc[4](loc1: u64)
111Branch(120)
B14:
112MoveLoc[2](Arg2: &Clock)
113Pop
114MoveLoc[0](Arg0: &mut Bucket<Ty0>)
115Pop
116MoveLoc[7](loc4: &Bottle)
117Pop
118LdU64(0)
119StLoc[4](loc1: u64)
B15:
120MoveLoc[4](loc1: u64)
121Ret
}
public(friend) handle_borrow<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: &BucketOracle, Arg2: address, Arg3: &Clock, Arg4: Balance<Ty0>, Arg5: u64, Arg6: Option<address>, Arg7: u64, Arg8: &mut TxContext) {
L9: loc0: address
L10: loc1: &BucketOracle
L11: loc2: &Clock
L12: loc3: &BucketOracle
L13: loc4: &Clock
L14: loc5: &Bottle
L15: loc6: address
L16: loc7: &mut Option<address>
L17: loc8: address
L18: loc9: Bottle
L19: loc10: Bottle
L20: loc11: bool
L21: loc12: u256
L22: loc13: Bottle
L23: loc14: u64
L24: loc15: InterestTable
L25: loc16: bool
L26: loc17: u64
L27: loc18: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1CopyLoc[2](Arg2: address)
2MutBorrowLoc[6](Arg6: Option<address>)
3StLoc[16](loc7: &mut Option<address>)
4StLoc[15](loc6: address)
5FreezeRef
6MoveLoc[15](loc6: address)
7MoveLoc[16](loc7: &mut Option<address>)
8Call check_insertion_place<Ty0>(&Bucket<Ty0>, address, &mut Option<address>)
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10FreezeRef
11Call is_not_locked<Ty0>(&Bucket<Ty0>): bool
12BrFalse(14)
B1:
13Branch(24)
B2:
14MoveLoc[1](Arg1: &BucketOracle)
15Pop
16MoveLoc[8](Arg8: &mut TxContext)
17Pop
18MoveLoc[3](Arg3: &Clock)
19Pop
20MoveLoc[0](Arg0: &mut Bucket<Ty0>)
21Pop
22LdConst[0](u64: 0)
23Abort
B3:
24LdFalse
25StLoc[25](loc16: bool)
26ImmBorrowLoc[4](Arg4: Balance<Ty0>)
27Call balance::value<Ty0>(&Balance<Ty0>): u64
28StLoc[23](loc14: u64)
29CopyLoc[0](Arg0: &mut Bucket<Ty0>)
30CopyLoc[2](Arg2: address)
31StLoc[17](loc8: address)
32FreezeRef
33MoveLoc[17](loc8: address)
34Call bottle_exists<Ty0>(&Bucket<Ty0>, address): bool
35BrFalse(56)
B4:
36CopyLoc[0](Arg0: &mut Bucket<Ty0>)
37FreezeRef
38Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
39BrFalse(45)
B5:
40CopyLoc[0](Arg0: &mut Bucket<Ty0>)
41CopyLoc[2](Arg2: address)
42CopyLoc[3](Arg3: &Clock)
43Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
44Pop
B6:
45CopyLoc[0](Arg0: &mut Bucket<Ty0>)
46CopyLoc[2](Arg2: address)
47Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
48Pop
49Pop
50CopyLoc[0](Arg0: &mut Bucket<Ty0>)
51MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
52CopyLoc[2](Arg2: address)
53Call bottle::remove_bottle(&mut BottleTable, address): Bottle
54StLoc[19](loc10: Bottle)
55Branch(88)
B7:
56CopyLoc[0](Arg0: &mut Bucket<Ty0>)
57ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
58CopyLoc[2](Arg2: address)
59Call table::contains<address, Bottle>(&Table<address, Bottle>, address): bool
60BrFalse(78)
B8:
61CopyLoc[0](Arg0: &mut Bucket<Ty0>)
62MutBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
63CopyLoc[2](Arg2: address)
64Call table::remove<address, Bottle>(&mut Table<address, Bottle>, address): Bottle
65Call bottle::destroy_surplus_bottle(Bottle): u64
66StLoc[27](loc18: u64)
67MoveLoc[23](loc14: u64)
68MoveLoc[27](loc18: u64)
69Add
70StLoc[23](loc14: u64)
71CopyLoc[0](Arg0: &mut Bucket<Ty0>)
72FreezeRef
73Call borrow_bottle_table<Ty0>(&Bucket<Ty0>): &BottleTable
74CopyLoc[8](Arg8: &mut TxContext)
75Call bottle::new(&BottleTable, &mut TxContext): Bottle
76StLoc[18](loc9: Bottle)
77Branch(86)
B9:
78LdTrue
79StLoc[25](loc16: bool)
80CopyLoc[0](Arg0: &mut Bucket<Ty0>)
81FreezeRef
82Call borrow_bottle_table<Ty0>(&Bucket<Ty0>): &BottleTable
83CopyLoc[8](Arg8: &mut TxContext)
84Call bottle::new(&BottleTable, &mut TxContext): Bottle
85StLoc[18](loc9: Bottle)
B10:
86MoveLoc[18](loc9: Bottle)
87StLoc[19](loc10: Bottle)
B11:
88MoveLoc[19](loc10: Bottle)
89StLoc[22](loc13: Bottle)
90CopyLoc[0](Arg0: &mut Bucket<Ty0>)
91FreezeRef
92Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
93BrFalse(103)
B12:
94CopyLoc[0](Arg0: &mut Bucket<Ty0>)
95CopyLoc[2](Arg2: address)
96StLoc[9](loc0: address)
97FreezeRef
98MoveLoc[9](loc0: address)
99Call bottle_exists<Ty0>(&Bucket<Ty0>, address): bool
100Not
101StLoc[20](loc11: bool)
102Branch(105)
B13:
103LdFalse
104StLoc[20](loc11: bool)
B14:
105MoveLoc[20](loc11: bool)
106BrFalse(117)
B15:
107CopyLoc[0](Arg0: &mut Bucket<Ty0>)
108FreezeRef
109Call borrow_interest_table<Ty0>(&Bucket<Ty0>): &InterestTable
110Call interest::get_active_interest_index(&InterestTable): u256
111StLoc[21](loc12: u256)
112MutBorrowLoc[22](loc13: Bottle)
113MoveLoc[21](loc12: u256)
114MoveLoc[8](Arg8: &mut TxContext)
115Call add_interest_index_to_bottle(&mut Bottle, u256, &mut TxContext)
116Branch(119)
B16:
117MoveLoc[8](Arg8: &mut TxContext)
118Pop
B17:
119MutBorrowLoc[22](loc13: Bottle)
120MoveLoc[23](loc14: u64)
121CopyLoc[5](Arg5: u64)
122MoveLoc[7](Arg7: u64)
123Call bottle::record_borrow(&mut Bottle, u64, u64, u64)
124CopyLoc[0](Arg0: &mut Bucket<Ty0>)
125MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
126MutBorrowLoc[22](loc13: Bottle)
127Call bottle::update_stake_and_total_stake(&mut BottleTable, &mut Bottle)
128MoveLoc[25](loc16: bool)
129BrFalse(134)
B18:
130CopyLoc[2](Arg2: address)
131ImmBorrowLoc[22](loc13: Bottle)
132Call bucket_events::emit_bottle_created<Ty0>(address, &Bottle)
133Branch(137)
B19:
134CopyLoc[2](Arg2: address)
135ImmBorrowLoc[22](loc13: Bottle)
136Call bucket_events::emit_bottle_updated<Ty0>(address, &Bottle)
B20:
137CopyLoc[0](Arg0: &mut Bucket<Ty0>)
138ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
139ReadRef
140MoveLoc[5](Arg5: u64)
141Add
142CopyLoc[0](Arg0: &mut Bucket<Ty0>)
143MutBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
144WriteRef
145CopyLoc[0](Arg0: &mut Bucket<Ty0>)
146MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
147MoveLoc[4](Arg4: Balance<Ty0>)
148Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
149Pop
150CopyLoc[0](Arg0: &mut Bucket<Ty0>)
151CopyLoc[1](Arg1: &BucketOracle)
152CopyLoc[3](Arg3: &Clock)
153StLoc[11](loc2: &Clock)
154StLoc[10](loc1: &BucketOracle)
155FreezeRef
156MoveLoc[10](loc1: &BucketOracle)
157MoveLoc[11](loc2: &Clock)
158Call is_in_recovery_mode<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock): bool
159Not
160BrFalse(162)
B21:
161Branch(170)
B22:
162MoveLoc[1](Arg1: &BucketOracle)
163Pop
164MoveLoc[3](Arg3: &Clock)
165Pop
166MoveLoc[0](Arg0: &mut Bucket<Ty0>)
167Pop
168LdConst[4](u64: 4)
169Abort
B23:
170CopyLoc[0](Arg0: &mut Bucket<Ty0>)
171MoveLoc[1](Arg1: &BucketOracle)
172CopyLoc[3](Arg3: &Clock)
173ImmBorrowLoc[22](loc13: Bottle)
174StLoc[14](loc5: &Bottle)
175StLoc[13](loc4: &Clock)
176StLoc[12](loc3: &BucketOracle)
177FreezeRef
178MoveLoc[12](loc3: &BucketOracle)
179MoveLoc[13](loc4: &Clock)
180MoveLoc[14](loc5: &Bottle)
181Call is_healthy_bottle<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock, &Bottle): bool
182BrFalse(184)
B24:
183Branch(190)
B25:
184MoveLoc[3](Arg3: &Clock)
185Pop
186MoveLoc[0](Arg0: &mut Bucket<Ty0>)
187Pop
188LdConst[4](u64: 4)
189Abort
B26:
190CopyLoc[0](Arg0: &mut Bucket<Ty0>)
191ImmBorrowFieldGeneric[5](Bucket.max_mint_amount: Option<u64>)
192Call option::is_some<u64>(&Option<u64>): bool
193BrFalse(212)
B27:
194CopyLoc[0](Arg0: &mut Bucket<Ty0>)
195ImmBorrowFieldGeneric[5](Bucket.max_mint_amount: Option<u64>)
196Call option::borrow<u64>(&Option<u64>): &u64
197ReadRef
198StLoc[26](loc17: u64)
199CopyLoc[0](Arg0: &mut Bucket<Ty0>)
200ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
201ReadRef
202MoveLoc[26](loc17: u64)
203Le
204BrFalse(206)
B28:
205Branch(212)
B29:
206MoveLoc[3](Arg3: &Clock)
207Pop
208MoveLoc[0](Arg0: &mut Bucket<Ty0>)
209Pop
210LdConst[5](u64: 5)
211Abort
B30:
212CopyLoc[0](Arg0: &mut Bucket<Ty0>)
213FreezeRef
214Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
215BrFalse(235)
B31:
216CopyLoc[0](Arg0: &mut Bucket<Ty0>)
217MutBorrowFieldGeneric[0](Bucket.id: UID)
218LdConst[10](vector<u8>: "int..)
219Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
220StLoc[24](loc15: InterestTable)
221CopyLoc[0](Arg0: &mut Bucket<Ty0>)
222MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
223ImmBorrowLoc[24](loc15: InterestTable)
224MoveLoc[2](Arg2: address)
225MoveLoc[22](loc13: Bottle)
226MoveLoc[6](Arg6: Option<address>)
227MoveLoc[3](Arg3: &Clock)
228Call bottle::insert_bottle(&mut BottleTable, &InterestTable, address, Bottle, Option<address>, &Clock)
229MoveLoc[0](Arg0: &mut Bucket<Ty0>)
230MutBorrowFieldGeneric[0](Bucket.id: UID)
231LdConst[10](vector<u8>: "int..)
232MoveLoc[24](loc15: InterestTable)
233Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
234Branch(243)
B32:
235MoveLoc[3](Arg3: &Clock)
236Pop
237MoveLoc[0](Arg0: &mut Bucket<Ty0>)
238MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
239MoveLoc[2](Arg2: address)
240MoveLoc[22](loc13: Bottle)
241MoveLoc[6](Arg6: Option<address>)
242Call bottle::insert(&mut BottleTable, address, Bottle, Option<address>)
B33:
243Ret
}
public(friend) handle_top_up<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: Balance<Ty0>, Arg2: address, Arg3: Option<address>, Arg4: &Clock) {
L5: loc0: address
L6: loc1: &mut Option<address>
L7: loc2: Bottle
L8: loc3: u64
L9: loc4: InterestTable
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1CopyLoc[2](Arg2: address)
2MutBorrowLoc[3](Arg3: Option<address>)
3StLoc[6](loc1: &mut Option<address>)
4StLoc[5](loc0: address)
5FreezeRef
6MoveLoc[5](loc0: address)
7MoveLoc[6](loc1: &mut Option<address>)
8Call check_insertion_place<Ty0>(&Bucket<Ty0>, address, &mut Option<address>)
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10CopyLoc[2](Arg2: address)
11Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
12Pop
13Pop
14CopyLoc[0](Arg0: &mut Bucket<Ty0>)
15MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
16CopyLoc[2](Arg2: address)
17Call bottle::remove_bottle(&mut BottleTable, address): Bottle
18StLoc[7](loc2: Bottle)
19ImmBorrowLoc[1](Arg1: Balance<Ty0>)
20Call balance::value<Ty0>(&Balance<Ty0>): u64
21StLoc[8](loc3: u64)
22MutBorrowLoc[7](loc2: Bottle)
23MoveLoc[8](loc3: u64)
24Call bottle::record_top_up(&mut Bottle, u64)
25CopyLoc[0](Arg0: &mut Bucket<Ty0>)
26MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
27MutBorrowLoc[7](loc2: Bottle)
28Call bottle::update_stake_and_total_stake(&mut BottleTable, &mut Bottle)
29CopyLoc[2](Arg2: address)
30ImmBorrowLoc[7](loc2: Bottle)
31Call bucket_events::emit_bottle_updated<Ty0>(address, &Bottle)
32CopyLoc[0](Arg0: &mut Bucket<Ty0>)
33FreezeRef
34Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
35BrFalse(55)
B1:
36CopyLoc[0](Arg0: &mut Bucket<Ty0>)
37MutBorrowFieldGeneric[0](Bucket.id: UID)
38LdConst[10](vector<u8>: "int..)
39Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
40StLoc[9](loc4: InterestTable)
41CopyLoc[0](Arg0: &mut Bucket<Ty0>)
42MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
43ImmBorrowLoc[9](loc4: InterestTable)
44MoveLoc[2](Arg2: address)
45MoveLoc[7](loc2: Bottle)
46MoveLoc[3](Arg3: Option<address>)
47MoveLoc[4](Arg4: &Clock)
48Call bottle::insert_bottle(&mut BottleTable, &InterestTable, address, Bottle, Option<address>, &Clock)
49CopyLoc[0](Arg0: &mut Bucket<Ty0>)
50MutBorrowFieldGeneric[0](Bucket.id: UID)
51LdConst[10](vector<u8>: "int..)
52MoveLoc[9](loc4: InterestTable)
53Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
54Branch(63)
B2:
55MoveLoc[4](Arg4: &Clock)
56Pop
57CopyLoc[0](Arg0: &mut Bucket<Ty0>)
58MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
59MoveLoc[2](Arg2: address)
60MoveLoc[7](loc2: Bottle)
61MoveLoc[3](Arg3: Option<address>)
62Call bottle::insert(&mut BottleTable, address, Bottle, Option<address>)
B3:
63MoveLoc[0](Arg0: &mut Bucket<Ty0>)
64MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
65MoveLoc[1](Arg1: Balance<Ty0>)
66Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
67Pop
68Ret
}
public(friend) handle_withdraw<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: &BucketOracle, Arg2: address, Arg3: &Clock, Arg4: u64, Arg5: Option<address>): Balance<Ty0> {
L6: loc0: &Bottle
L7: loc1: address
L8: loc2: &mut Option<address>
L9: loc3: &BucketOracle
L10: loc4: &Clock
L11: loc5: &BucketOracle
L12: loc6: &Clock
L13: loc7: Bottle
L14: loc8: Balance<Ty0>
L15: loc9: InterestTable
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
3BrFalse(9)
B1:
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5CopyLoc[2](Arg2: address)
6CopyLoc[3](Arg3: &Clock)
7Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
8Pop
B2:
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10CopyLoc[2](Arg2: address)
11MutBorrowLoc[5](Arg5: Option<address>)
12StLoc[8](loc2: &mut Option<address>)
13StLoc[7](loc1: address)
14FreezeRef
15MoveLoc[7](loc1: address)
16MoveLoc[8](loc2: &mut Option<address>)
17Call check_insertion_place<Ty0>(&Bucket<Ty0>, address, &mut Option<address>)
18CopyLoc[0](Arg0: &mut Bucket<Ty0>)
19CopyLoc[2](Arg2: address)
20Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
21Pop
22Pop
23CopyLoc[0](Arg0: &mut Bucket<Ty0>)
24MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
25CopyLoc[2](Arg2: address)
26Call bottle::remove_bottle(&mut BottleTable, address): Bottle
27StLoc[13](loc7: Bottle)
28MutBorrowLoc[13](loc7: Bottle)
29CopyLoc[4](Arg4: u64)
30Call bottle::record_withdraw(&mut Bottle, u64)
31CopyLoc[0](Arg0: &mut Bucket<Ty0>)
32MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
33MutBorrowLoc[13](loc7: Bottle)
34Call bottle::update_stake_and_total_stake(&mut BottleTable, &mut Bottle)
35CopyLoc[0](Arg0: &mut Bucket<Ty0>)
36MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
37MoveLoc[4](Arg4: u64)
38Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
39StLoc[14](loc8: Balance<Ty0>)
40CopyLoc[0](Arg0: &mut Bucket<Ty0>)
41CopyLoc[1](Arg1: &BucketOracle)
42CopyLoc[3](Arg3: &Clock)
43StLoc[10](loc4: &Clock)
44StLoc[9](loc3: &BucketOracle)
45FreezeRef
46MoveLoc[9](loc3: &BucketOracle)
47MoveLoc[10](loc4: &Clock)
48Call is_in_recovery_mode<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock): bool
49Not
50BrFalse(52)
B3:
51Branch(60)
B4:
52MoveLoc[1](Arg1: &BucketOracle)
53Pop
54MoveLoc[3](Arg3: &Clock)
55Pop
56MoveLoc[0](Arg0: &mut Bucket<Ty0>)
57Pop
58LdConst[4](u64: 4)
59Abort
B5:
60CopyLoc[0](Arg0: &mut Bucket<Ty0>)
61MoveLoc[1](Arg1: &BucketOracle)
62CopyLoc[3](Arg3: &Clock)
63ImmBorrowLoc[13](loc7: Bottle)
64StLoc[6](loc0: &Bottle)
65StLoc[12](loc6: &Clock)
66StLoc[11](loc5: &BucketOracle)
67FreezeRef
68MoveLoc[11](loc5: &BucketOracle)
69MoveLoc[12](loc6: &Clock)
70MoveLoc[6](loc0: &Bottle)
71Call is_healthy_bottle<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock, &Bottle): bool
72BrFalse(74)
B6:
73Branch(80)
B7:
74MoveLoc[3](Arg3: &Clock)
75Pop
76MoveLoc[0](Arg0: &mut Bucket<Ty0>)
77Pop
78LdConst[4](u64: 4)
79Abort
B8:
80CopyLoc[2](Arg2: address)
81ImmBorrowLoc[13](loc7: Bottle)
82Call bucket_events::emit_bottle_updated<Ty0>(address, &Bottle)
83CopyLoc[0](Arg0: &mut Bucket<Ty0>)
84FreezeRef
85Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
86BrFalse(106)
B9:
87CopyLoc[0](Arg0: &mut Bucket<Ty0>)
88MutBorrowFieldGeneric[0](Bucket.id: UID)
89LdConst[10](vector<u8>: "int..)
90Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
91StLoc[15](loc9: InterestTable)
92CopyLoc[0](Arg0: &mut Bucket<Ty0>)
93MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
94ImmBorrowLoc[15](loc9: InterestTable)
95MoveLoc[2](Arg2: address)
96MoveLoc[13](loc7: Bottle)
97MoveLoc[5](Arg5: Option<address>)
98MoveLoc[3](Arg3: &Clock)
99Call bottle::insert_bottle(&mut BottleTable, &InterestTable, address, Bottle, Option<address>, &Clock)
100MoveLoc[0](Arg0: &mut Bucket<Ty0>)
101MutBorrowFieldGeneric[0](Bucket.id: UID)
102LdConst[10](vector<u8>: "int..)
103MoveLoc[15](loc9: InterestTable)
104Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
105Branch(114)
B10:
106MoveLoc[3](Arg3: &Clock)
107Pop
108MoveLoc[0](Arg0: &mut Bucket<Ty0>)
109MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
110MoveLoc[2](Arg2: address)
111MoveLoc[13](loc7: Bottle)
112MoveLoc[5](Arg5: Option<address>)
113Call bottle::insert(&mut BottleTable, address, Bottle, Option<address>)
B11:
114MoveLoc[14](loc8: Balance<Ty0>)
115Ret
}
public(friend) handle_repay<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: u64, Arg3: u64, Arg4: bool, Arg5: &Clock): Balance<Ty0> {
L6: loc0: u64
L7: loc1: &mut Bottle
L8: loc2: u64
L9: loc3: InterestTable
L10: loc4: bool
L11: loc5: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
3BrFalse(9)
B1:
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5CopyLoc[1](Arg1: address)
6CopyLoc[5](Arg5: &Clock)
7Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
8Pop
B2:
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10CopyLoc[1](Arg1: address)
11Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
12StLoc[8](loc2: u64)
13Pop
14MoveLoc[8](loc2: u64)
15CopyLoc[2](Arg2: u64)
16Ge
17BrFalse(19)
B3:
18Branch(25)
B4:
19MoveLoc[5](Arg5: &Clock)
20Pop
21MoveLoc[0](Arg0: &mut Bucket<Ty0>)
22Pop
23LdConst[1](u64: 1)
24Abort
B5:
25CopyLoc[0](Arg0: &mut Bucket<Ty0>)
26MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
27CopyLoc[1](Arg1: address)
28Call bottle::borrow_bottle_mut(&mut BottleTable, address): &mut Bottle
29StLoc[7](loc1: &mut Bottle)
30CopyLoc[7](loc1: &mut Bottle)
31CopyLoc[2](Arg2: u64)
32MoveLoc[3](Arg3: u64)
33MoveLoc[4](Arg4: bool)
34Call bottle::record_repay(&mut Bottle, u64, u64, bool): bool * u64
35StLoc[11](loc5: u64)
36StLoc[10](loc4: bool)
37CopyLoc[10](loc4: bool)
38BrFalse(44)
B6:
39CopyLoc[1](Arg1: address)
40MoveLoc[7](loc1: &mut Bottle)
41FreezeRef
42Call bucket_events::emit_bottle_destroyed<Ty0>(address, &Bottle)
43Branch(48)
B7:
44CopyLoc[1](Arg1: address)
45MoveLoc[7](loc1: &mut Bottle)
46FreezeRef
47Call bucket_events::emit_bottle_updated<Ty0>(address, &Bottle)
B8:
48CopyLoc[0](Arg0: &mut Bucket<Ty0>)
49MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
50CopyLoc[1](Arg1: address)
51Call bottle::update_stake_and_total_stake_by_debtor(&mut BottleTable, address)
52MoveLoc[10](loc4: bool)
53BrFalse(61)
B9:
54MoveLoc[5](Arg5: &Clock)
55Pop
56CopyLoc[0](Arg0: &mut Bucket<Ty0>)
57MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
58MoveLoc[1](Arg1: address)
59Call bottle::destroy_bottle(&mut BottleTable, address)
60Branch(88)
B10:
61CopyLoc[0](Arg0: &mut Bucket<Ty0>)
62FreezeRef
63Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
64BrFalse(82)
B11:
65CopyLoc[0](Arg0: &mut Bucket<Ty0>)
66MutBorrowFieldGeneric[0](Bucket.id: UID)
67LdConst[10](vector<u8>: "int..)
68Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
69StLoc[9](loc3: InterestTable)
70CopyLoc[0](Arg0: &mut Bucket<Ty0>)
71MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
72ImmBorrowLoc[9](loc3: InterestTable)
73MoveLoc[1](Arg1: address)
74MoveLoc[5](Arg5: &Clock)
75Call bottle::re_insert_bottle(&mut BottleTable, &InterestTable, address, &Clock)
76CopyLoc[0](Arg0: &mut Bucket<Ty0>)
77MutBorrowFieldGeneric[0](Bucket.id: UID)
78LdConst[10](vector<u8>: "int..)
79MoveLoc[9](loc3: InterestTable)
80Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
81Branch(88)
B12:
82MoveLoc[5](Arg5: &Clock)
83Pop
84CopyLoc[0](Arg0: &mut Bucket<Ty0>)
85MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
86MoveLoc[1](Arg1: address)
87Call bottle::re_insert(&mut BottleTable, address)
B13:
88CopyLoc[0](Arg0: &mut Bucket<Ty0>)
89ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
90ReadRef
91CopyLoc[2](Arg2: u64)
92Ge
93BrFalse(101)
B14:
94CopyLoc[0](Arg0: &mut Bucket<Ty0>)
95ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
96ReadRef
97MoveLoc[2](Arg2: u64)
98Sub
99StLoc[6](loc0: u64)
100Branch(103)
B15:
101LdU64(0)
102StLoc[6](loc0: u64)
B16:
103MoveLoc[6](loc0: u64)
104CopyLoc[0](Arg0: &mut Bucket<Ty0>)
105MutBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
106WriteRef
107MoveLoc[0](Arg0: &mut Bucket<Ty0>)
108MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
109MoveLoc[11](loc5: u64)
110Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
111Ret
}
public(friend) handle_transfer<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: address, Arg3: &Clock) {
L4: loc0: address
L5: loc1: Bottle
L6: loc2: Option<address>
L7: loc3: InterestTable
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
3BrFalse(9)
B1:
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5CopyLoc[1](Arg1: address)
6CopyLoc[3](Arg3: &Clock)
7Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
8Pop
B2:
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10CopyLoc[1](Arg1: address)
11Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
12Pop
13Pop
14CopyLoc[0](Arg0: &mut Bucket<Ty0>)
15CopyLoc[1](Arg1: address)
16StLoc[4](loc0: address)
17FreezeRef
18MoveLoc[4](loc0: address)
19Call prev_debtor<Ty0>(&Bucket<Ty0>, address): &Option<address>
20ReadRef
21StLoc[6](loc2: Option<address>)
22CopyLoc[0](Arg0: &mut Bucket<Ty0>)
23MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
24MoveLoc[1](Arg1: address)
25Call bottle::remove_bottle(&mut BottleTable, address): Bottle
26StLoc[5](loc1: Bottle)
27CopyLoc[0](Arg0: &mut Bucket<Ty0>)
28FreezeRef
29Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
30BrFalse(50)
B3:
31CopyLoc[0](Arg0: &mut Bucket<Ty0>)
32MutBorrowFieldGeneric[0](Bucket.id: UID)
33LdConst[10](vector<u8>: "int..)
34Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
35StLoc[7](loc3: InterestTable)
36CopyLoc[0](Arg0: &mut Bucket<Ty0>)
37MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
38ImmBorrowLoc[7](loc3: InterestTable)
39MoveLoc[2](Arg2: address)
40MoveLoc[5](loc1: Bottle)
41MoveLoc[6](loc2: Option<address>)
42MoveLoc[3](Arg3: &Clock)
43Call bottle::insert_bottle(&mut BottleTable, &InterestTable, address, Bottle, Option<address>, &Clock)
44MoveLoc[0](Arg0: &mut Bucket<Ty0>)
45MutBorrowFieldGeneric[0](Bucket.id: UID)
46LdConst[10](vector<u8>: "int..)
47MoveLoc[7](loc3: InterestTable)
48Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
49Branch(58)
B4:
50MoveLoc[3](Arg3: &Clock)
51Pop
52MoveLoc[0](Arg0: &mut Bucket<Ty0>)
53MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
54MoveLoc[2](Arg2: address)
55MoveLoc[5](loc1: Bottle)
56MoveLoc[6](loc2: Option<address>)
57Call bottle::insert(&mut BottleTable, address, Bottle, Option<address>)
B5:
58Ret
}
public(friend) handle_repay_capped<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: u64, Arg3: &BucketOracle, Arg4: &Clock): Balance<Ty0> {
L5: loc0: u64
L6: loc1: &mut Bottle
L7: loc2: Bottle
L8: loc3: u64
L9: loc4: u64
L10: loc5: bool
L11: loc6: u64
L12: loc7: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
3BrFalse(9)
B1:
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5CopyLoc[1](Arg1: address)
6CopyLoc[4](Arg4: &Clock)
7Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
8Pop
B2:
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10CopyLoc[1](Arg1: address)
11Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
12StLoc[9](loc4: u64)
13Pop
14MoveLoc[9](loc4: u64)
15CopyLoc[2](Arg2: u64)
16Ge
17BrFalse(19)
B3:
18Branch(27)
B4:
19MoveLoc[3](Arg3: &BucketOracle)
20Pop
21MoveLoc[4](Arg4: &Clock)
22Pop
23MoveLoc[0](Arg0: &mut Bucket<Ty0>)
24Pop
25LdConst[1](u64: 1)
26Abort
B5:
27CopyLoc[0](Arg0: &mut Bucket<Ty0>)
28FreezeRef
29Call get_minimum_collateral_ratio<Ty0>(&Bucket<Ty0>): u64
30StLoc[11](loc6: u64)
31CopyLoc[0](Arg0: &mut Bucket<Ty0>)
32MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
33CopyLoc[1](Arg1: address)
34Call bottle::borrow_bottle_mut(&mut BottleTable, address): &mut Bottle
35StLoc[6](loc1: &mut Bottle)
36CopyLoc[6](loc1: &mut Bottle)
37CopyLoc[2](Arg2: u64)
38MoveLoc[3](Arg3: &BucketOracle)
39MoveLoc[4](Arg4: &Clock)
40MoveLoc[11](loc6: u64)
41CopyLoc[0](Arg0: &mut Bucket<Ty0>)
42ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
43ReadRef
44Call bottle::record_repay_capped<Ty0>(&mut Bottle, u64, &BucketOracle, &Clock, u64, u8): bool * u64
45StLoc[12](loc7: u64)
46StLoc[10](loc5: bool)
47CopyLoc[10](loc5: bool)
48BrFalse(54)
B6:
49CopyLoc[1](Arg1: address)
50MoveLoc[6](loc1: &mut Bottle)
51FreezeRef
52Call bucket_events::emit_bottle_destroyed<Ty0>(address, &Bottle)
53Branch(56)
B7:
54MoveLoc[6](loc1: &mut Bottle)
55Pop
B8:
56CopyLoc[0](Arg0: &mut Bucket<Ty0>)
57MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
58CopyLoc[1](Arg1: address)
59Call bottle::update_stake_and_total_stake_by_debtor(&mut BottleTable, address)
60CopyLoc[0](Arg0: &mut Bucket<Ty0>)
61ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
62CopyLoc[1](Arg1: address)
63Call bottle::get_bottle_info_by_debtor(&BottleTable, address): u64 * u64
64Pop
65StLoc[8](loc3: u64)
66MoveLoc[10](loc5: bool)
67BrFalse(90)
B9:
68MoveLoc[8](loc3: u64)
69LdU64(0)
70Eq
71BrFalse(77)
B10:
72CopyLoc[0](Arg0: &mut Bucket<Ty0>)
73MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
74MoveLoc[1](Arg1: address)
75Call bottle::destroy_bottle(&mut BottleTable, address)
76Branch(90)
B11:
77CopyLoc[0](Arg0: &mut Bucket<Ty0>)
78MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
79CopyLoc[1](Arg1: address)
80Call bottle::remove_bottle(&mut BottleTable, address): Bottle
81StLoc[7](loc2: Bottle)
82CopyLoc[1](Arg1: address)
83ImmBorrowLoc[7](loc2: Bottle)
84Call bucket_events::emit_surplus_bottle_generated<Ty0>(address, &Bottle)
85CopyLoc[0](Arg0: &mut Bucket<Ty0>)
86MutBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
87MoveLoc[1](Arg1: address)
88MoveLoc[7](loc2: Bottle)
89Call table::add<address, Bottle>(&mut Table<address, Bottle>, address, Bottle)
B12:
90CopyLoc[0](Arg0: &mut Bucket<Ty0>)
91ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
92ReadRef
93CopyLoc[2](Arg2: u64)
94Ge
95BrFalse(103)
B13:
96CopyLoc[0](Arg0: &mut Bucket<Ty0>)
97ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
98ReadRef
99MoveLoc[2](Arg2: u64)
100Sub
101StLoc[5](loc0: u64)
102Branch(105)
B14:
103LdU64(0)
104StLoc[5](loc0: u64)
B15:
105MoveLoc[5](loc0: u64)
106CopyLoc[0](Arg0: &mut Bucket<Ty0>)
107MutBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
108WriteRef
109MoveLoc[0](Arg0: &mut Bucket<Ty0>)
110MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
111MoveLoc[12](loc7: u64)
112Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
113Ret
}
public(friend) handle_redeem<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock, Arg3: u64, Arg4: Option<address>): Balance<Ty0> {
L5: loc0: bool
L6: loc1: u64
L7: loc2: Bottle
L8: loc3: u64
L9: loc4: Balance<Ty0>
L10: loc5: address
L11: loc6: address
L12: loc7: u64
L13: loc8: InterestTable
L14: loc9: u64
L15: loc10: u64
L16: loc11: u64
L17: loc12: u64
B0:
0MoveLoc[1](Arg1: &BucketOracle)
1CopyLoc[2](Arg2: &Clock)
2Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
3StLoc[12](loc7: u64)
4StLoc[14](loc9: u64)
5Call balance::zero<Ty0>(): Balance<Ty0>
6StLoc[9](loc4: Balance<Ty0>)
7CopyLoc[3](Arg3: u64)
8StLoc[17](loc12: u64)
B1:
9CopyLoc[17](loc12: u64)
10LdU64(0)
11Gt
12BrFalse(21)
B2:
13Branch(14)
B3:
14CopyLoc[0](Arg0: &mut Bucket<Ty0>)
15ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
16Call bottle::get_table_length(&BottleTable): u64
17LdU64(0)
18Gt
19StLoc[5](loc0: bool)
20Branch(23)
B4:
21LdFalse
22StLoc[5](loc0: bool)
B5:
23MoveLoc[5](loc0: bool)
24BrFalse(153)
B6:
25CopyLoc[0](Arg0: &mut Bucket<Ty0>)
26ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
27Call bottle::get_lowest_cr_debtor(&BottleTable): Option<address>
28Call option::destroy_some<address>(Option<address>): address
29StLoc[10](loc5: address)
30CopyLoc[0](Arg0: &mut Bucket<Ty0>)
31FreezeRef
32Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
33BrFalse(39)
B7:
34CopyLoc[0](Arg0: &mut Bucket<Ty0>)
35CopyLoc[10](loc5: address)
36CopyLoc[2](Arg2: &Clock)
37Call accrue_interests_by_debtor<Ty0>(&mut Bucket<Ty0>, address, &Clock): u64
38Pop
B8:
39CopyLoc[0](Arg0: &mut Bucket<Ty0>)
40MoveLoc[10](loc5: address)
41Call apply_pending<Ty0>(&mut Bucket<Ty0>, address): u64 * u64
42StLoc[8](loc3: u64)
43Pop
44CopyLoc[0](Arg0: &mut Bucket<Ty0>)
45MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
46Call bottle::pop_front(&mut BottleTable): address * Bottle
47StLoc[7](loc2: Bottle)
48StLoc[11](loc6: address)
49CopyLoc[17](loc12: u64)
50CopyLoc[8](loc3: u64)
51Ge
52BrFalse(54)
B9:
53Branch(114)
B10:
54CopyLoc[17](loc12: u64)
55CopyLoc[0](Arg0: &mut Bucket<Ty0>)
56ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
57ReadRef
58MoveLoc[14](loc9: u64)
59MoveLoc[12](loc7: u64)
60Call compute_buck_value_to_collateral(u64, u8, u64, u64): u64
61StLoc[16](loc11: u64)
62MutBorrowLoc[7](loc2: Bottle)
63CopyLoc[16](loc11: u64)
64MoveLoc[17](loc12: u64)
65Call bottle::record_redeem(&mut Bottle, u64, u64)
66CopyLoc[11](loc6: address)
67ImmBorrowLoc[7](loc2: Bottle)
68Call bucket_events::emit_bottle_updated<Ty0>(address, &Bottle)
69MutBorrowLoc[9](loc4: Balance<Ty0>)
70CopyLoc[0](Arg0: &mut Bucket<Ty0>)
71MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
72MoveLoc[16](loc11: u64)
73Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
74Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
75Pop
76CopyLoc[0](Arg0: &mut Bucket<Ty0>)
77FreezeRef
78Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
79BrFalse(99)
B11:
80CopyLoc[0](Arg0: &mut Bucket<Ty0>)
81MutBorrowFieldGeneric[0](Bucket.id: UID)
82LdConst[10](vector<u8>: "int..)
83Call dynamic_object_field::remove<vector<u8>, InterestTable>(&mut UID, vector<u8>): InterestTable
84StLoc[13](loc8: InterestTable)
85CopyLoc[0](Arg0: &mut Bucket<Ty0>)
86MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
87ImmBorrowLoc[13](loc8: InterestTable)
88CopyLoc[11](loc6: address)
89MoveLoc[7](loc2: Bottle)
90MoveLoc[4](Arg4: Option<address>)
91MoveLoc[2](Arg2: &Clock)
92Call bottle::insert_bottle(&mut BottleTable, &InterestTable, address, Bottle, Option<address>, &Clock)
93CopyLoc[0](Arg0: &mut Bucket<Ty0>)
94MutBorrowFieldGeneric[0](Bucket.id: UID)
95LdConst[10](vector<u8>: "int..)
96MoveLoc[13](loc8: InterestTable)
97Call dynamic_object_field::add<vector<u8>, InterestTable>(&mut UID, vector<u8>, InterestTable)
98Branch(107)
B12:
99MoveLoc[2](Arg2: &Clock)
100Pop
101CopyLoc[0](Arg0: &mut Bucket<Ty0>)
102MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
103CopyLoc[11](loc6: address)
104MoveLoc[7](loc2: Bottle)
105MoveLoc[4](Arg4: Option<address>)
106Call bottle::insert(&mut BottleTable, address, Bottle, Option<address>)
B13:
107LdU64(0)
108StLoc[17](loc12: u64)
109CopyLoc[0](Arg0: &mut Bucket<Ty0>)
110MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
111MoveLoc[11](loc6: address)
112Call bottle::update_stake_and_total_stake_by_debtor(&mut BottleTable, address)
113Branch(153)
B14:
114CopyLoc[8](loc3: u64)
115CopyLoc[0](Arg0: &mut Bucket<Ty0>)
116ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
117ReadRef
118CopyLoc[14](loc9: u64)
119CopyLoc[12](loc7: u64)
120Call compute_buck_value_to_collateral(u64, u8, u64, u64): u64
121StLoc[15](loc10: u64)
122MutBorrowLoc[7](loc2: Bottle)
123CopyLoc[15](loc10: u64)
124CopyLoc[8](loc3: u64)
125Call bottle::record_redeem(&mut Bottle, u64, u64)
126CopyLoc[11](loc6: address)
127ImmBorrowLoc[7](loc2: Bottle)
128Call bucket_events::emit_bottle_destroyed<Ty0>(address, &Bottle)
129CopyLoc[11](loc6: address)
130ImmBorrowLoc[7](loc2: Bottle)
131Call bucket_events::emit_surplus_bottle_generated<Ty0>(address, &Bottle)
132CopyLoc[0](Arg0: &mut Bucket<Ty0>)
133MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
134MutBorrowLoc[7](loc2: Bottle)
135Call bottle::update_stake_and_total_stake(&mut BottleTable, &mut Bottle)
136MutBorrowLoc[9](loc4: Balance<Ty0>)
137CopyLoc[0](Arg0: &mut Bucket<Ty0>)
138MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
139MoveLoc[15](loc10: u64)
140Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
141Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
142Pop
143CopyLoc[0](Arg0: &mut Bucket<Ty0>)
144MutBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
145MoveLoc[11](loc6: address)
146MoveLoc[7](loc2: Bottle)
147Call table::add<address, Bottle>(&mut Table<address, Bottle>, address, Bottle)
148MoveLoc[17](loc12: u64)
149MoveLoc[8](loc3: u64)
150Sub
151StLoc[17](loc12: u64)
152Branch(9)
B15:
153MoveLoc[17](loc12: u64)
154LdU64(0)
155Eq
156BrFalse(158)
B16:
157Branch(162)
B17:
158MoveLoc[0](Arg0: &mut Bucket<Ty0>)
159Pop
160LdConst[3](u64: 3)
161Abort
B18:
162CopyLoc[0](Arg0: &mut Bucket<Ty0>)
163ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
164ReadRef
165CopyLoc[3](Arg3: u64)
166Ge
167BrFalse(175)
B19:
168CopyLoc[0](Arg0: &mut Bucket<Ty0>)
169ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
170ReadRef
171CopyLoc[3](Arg3: u64)
172Sub
173StLoc[6](loc1: u64)
174Branch(177)
B20:
175LdU64(0)
176StLoc[6](loc1: u64)
B21:
177MoveLoc[6](loc1: u64)
178MoveLoc[0](Arg0: &mut Bucket<Ty0>)
179MutBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
180WriteRef
181MoveLoc[3](Arg3: u64)
182ImmBorrowLoc[9](loc4: Balance<Ty0>)
183Call balance::value<Ty0>(&Balance<Ty0>): u64
184Call bucket_events::emit_redeem<Ty0>(u64, u64)
185MoveLoc[9](loc4: Balance<Ty0>)
186Ret
}
public bottle_exists<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): bool {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2MoveLoc[1](Arg1: address)
3Call bottle::bottle_exists(&BottleTable, address): bool
4Ret
}
public get_bottle_info<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &Bottle): u64 * u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2MoveLoc[1](Arg1: &Bottle)
3Call bottle::get_bottle_info(&BottleTable, &Bottle): u64 * u64
4Ret
}
public get_bottle_info_by_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): u64 * u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2MoveLoc[1](Arg1: address)
3Call bottle::get_bottle_info_by_debtor(&BottleTable, address): u64 * u64
4Ret
}
public get_bottle_info_with_interest<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &Bottle, Arg2: &Clock): u64 * u64 {
L3: loc0: u64
L4: loc1: u64
L5: loc2: &BottleTable
L6: loc3: &InterestTable
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call borrow_bottle_table<Ty0>(&Bucket<Ty0>): &BottleTable
2StLoc[5](loc2: &BottleTable)
3CopyLoc[0](Arg0: &Bucket<Ty0>)
4ImmBorrowFieldGeneric[0](Bucket.id: UID)
5LdConst[10](vector<u8>: "int..)
6Call dynamic_object_field::exists_with_type<vector<u8>, InterestTable>(&UID, vector<u8>): bool
7BrFalse(19)
B1:
8MoveLoc[0](Arg0: &Bucket<Ty0>)
9Call borrow_interest_table<Ty0>(&Bucket<Ty0>): &InterestTable
10StLoc[6](loc3: &InterestTable)
11MoveLoc[5](loc2: &BottleTable)
12MoveLoc[1](Arg1: &Bottle)
13MoveLoc[6](loc3: &InterestTable)
14MoveLoc[2](Arg2: &Clock)
15Call bottle::get_bottle_info_with_interest(&BottleTable, &Bottle, &InterestTable, &Clock): u64 * u64
16StLoc[4](loc1: u64)
17StLoc[3](loc0: u64)
18Branch(28)
B2:
19MoveLoc[2](Arg2: &Clock)
20Pop
21MoveLoc[0](Arg0: &Bucket<Ty0>)
22Pop
23MoveLoc[5](loc2: &BottleTable)
24MoveLoc[1](Arg1: &Bottle)
25Call bottle::get_bottle_info(&BottleTable, &Bottle): u64 * u64
26StLoc[4](loc1: u64)
27StLoc[3](loc0: u64)
B3:
28MoveLoc[3](loc0: u64)
29MoveLoc[4](loc1: u64)
30Ret
}
public get_bottle_info_with_interest_by_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address, Arg2: &Clock): u64 * u64 {
L3: loc0: u64
L4: loc1: u64
L5: loc2: &BottleTable
L6: loc3: &InterestTable
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call borrow_bottle_table<Ty0>(&Bucket<Ty0>): &BottleTable
2StLoc[5](loc2: &BottleTable)
3CopyLoc[0](Arg0: &Bucket<Ty0>)
4ImmBorrowFieldGeneric[0](Bucket.id: UID)
5LdConst[10](vector<u8>: "int..)
6Call dynamic_object_field::exists_with_type<vector<u8>, InterestTable>(&UID, vector<u8>): bool
7BrFalse(19)
B1:
8MoveLoc[0](Arg0: &Bucket<Ty0>)
9Call borrow_interest_table<Ty0>(&Bucket<Ty0>): &InterestTable
10StLoc[6](loc3: &InterestTable)
11MoveLoc[5](loc2: &BottleTable)
12MoveLoc[1](Arg1: address)
13MoveLoc[6](loc3: &InterestTable)
14MoveLoc[2](Arg2: &Clock)
15Call bottle::get_bottle_info_with_interest_by_debtor(&BottleTable, address, &InterestTable, &Clock): u64 * u64
16StLoc[4](loc1: u64)
17StLoc[3](loc0: u64)
18Branch(28)
B2:
19MoveLoc[2](Arg2: &Clock)
20Pop
21MoveLoc[0](Arg0: &Bucket<Ty0>)
22Pop
23MoveLoc[5](loc2: &BottleTable)
24MoveLoc[1](Arg1: address)
25Call bottle::get_bottle_info_by_debtor(&BottleTable, address): u64 * u64
26StLoc[4](loc1: u64)
27StLoc[3](loc0: u64)
B3:
28MoveLoc[3](loc0: u64)
29MoveLoc[4](loc1: u64)
30Ret
}
public get_surplus_bottle_info_by_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): u64 * u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
2MoveLoc[1](Arg1: address)
3Call table::borrow<address, Bottle>(&Table<address, Bottle>, address): &Bottle
4Call bottle::get_bottle_raw_info(&Bottle): u64 * u64
5Ret
}
public is_healthy_bottle<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock, Arg3: &Bottle): bool {
L4: loc0: u64
L5: loc1: u64
L6: loc2: u64
L7: loc3: u64
L8: loc4: u64
L9: loc5: u64
L10: loc6: u64
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1CopyLoc[1](Arg1: &BucketOracle)
2CopyLoc[2](Arg2: &Clock)
3Call is_in_recovery_mode<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock): bool
4BrFalse(10)
B1:
5CopyLoc[0](Arg0: &Bucket<Ty0>)
6ImmBorrowFieldGeneric[7](Bucket.recovery_mode_threshold: u64)
7ReadRef
8StLoc[4](loc0: u64)
9Branch(14)
B2:
10CopyLoc[0](Arg0: &Bucket<Ty0>)
11ImmBorrowFieldGeneric[8](Bucket.min_collateral_ratio: u64)
12ReadRef
13StLoc[4](loc0: u64)
B3:
14MoveLoc[4](loc0: u64)
15StLoc[9](loc5: u64)
16MoveLoc[1](Arg1: &BucketOracle)
17CopyLoc[2](Arg2: &Clock)
18Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
19StLoc[8](loc4: u64)
20StLoc[10](loc6: u64)
21CopyLoc[0](Arg0: &Bucket<Ty0>)
22Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
23BrFalse(31)
B4:
24CopyLoc[0](Arg0: &Bucket<Ty0>)
25MoveLoc[3](Arg3: &Bottle)
26MoveLoc[2](Arg2: &Clock)
27Call get_bottle_info_with_interest<Ty0>(&Bucket<Ty0>, &Bottle, &Clock): u64 * u64
28StLoc[6](loc2: u64)
29StLoc[5](loc1: u64)
30Branch(38)
B5:
31MoveLoc[2](Arg2: &Clock)
32Pop
33CopyLoc[0](Arg0: &Bucket<Ty0>)
34MoveLoc[3](Arg3: &Bottle)
35Call get_bottle_info<Ty0>(&Bucket<Ty0>, &Bottle): u64 * u64
36StLoc[6](loc2: u64)
37StLoc[5](loc1: u64)
B6:
38MoveLoc[5](loc1: u64)
39MoveLoc[6](loc2: u64)
40StLoc[7](loc3: u64)
41MoveLoc[0](Arg0: &Bucket<Ty0>)
42ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
43ReadRef
44MoveLoc[10](loc6: u64)
45MoveLoc[8](loc4: u64)
46Call compute_collateral_value_to_buck(u64, u8, u64, u64): u64
47MoveLoc[7](loc3: u64)
48MoveLoc[9](loc5: u64)
49LdU64(100)
50Call math::mul_factor(u64, u64, u64): u64
51Ge
52Ret
}
public is_healthy_bottle_by_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock, Arg3: address): bool {
L4: loc0: u64
L5: loc1: u64
L6: loc2: u64
L7: loc3: u64
L8: loc4: u64
L9: loc5: u64
L10: loc6: u64
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1CopyLoc[1](Arg1: &BucketOracle)
2CopyLoc[2](Arg2: &Clock)
3Call is_in_recovery_mode<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock): bool
4BrFalse(10)
B1:
5CopyLoc[0](Arg0: &Bucket<Ty0>)
6ImmBorrowFieldGeneric[7](Bucket.recovery_mode_threshold: u64)
7ReadRef
8StLoc[4](loc0: u64)
9Branch(14)
B2:
10CopyLoc[0](Arg0: &Bucket<Ty0>)
11ImmBorrowFieldGeneric[8](Bucket.min_collateral_ratio: u64)
12ReadRef
13StLoc[4](loc0: u64)
B3:
14MoveLoc[4](loc0: u64)
15StLoc[9](loc5: u64)
16MoveLoc[1](Arg1: &BucketOracle)
17CopyLoc[2](Arg2: &Clock)
18Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
19StLoc[8](loc4: u64)
20StLoc[10](loc6: u64)
21CopyLoc[0](Arg0: &Bucket<Ty0>)
22Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
23BrFalse(31)
B4:
24CopyLoc[0](Arg0: &Bucket<Ty0>)
25MoveLoc[3](Arg3: address)
26MoveLoc[2](Arg2: &Clock)
27Call get_bottle_info_with_interest_by_debtor<Ty0>(&Bucket<Ty0>, address, &Clock): u64 * u64
28StLoc[6](loc2: u64)
29StLoc[5](loc1: u64)
30Branch(38)
B5:
31MoveLoc[2](Arg2: &Clock)
32Pop
33CopyLoc[0](Arg0: &Bucket<Ty0>)
34MoveLoc[3](Arg3: address)
35Call get_bottle_info_by_debtor<Ty0>(&Bucket<Ty0>, address): u64 * u64
36StLoc[6](loc2: u64)
37StLoc[5](loc1: u64)
B6:
38MoveLoc[5](loc1: u64)
39MoveLoc[6](loc2: u64)
40StLoc[7](loc3: u64)
41MoveLoc[0](Arg0: &Bucket<Ty0>)
42ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
43ReadRef
44MoveLoc[10](loc6: u64)
45MoveLoc[8](loc4: u64)
46Call compute_collateral_value_to_buck(u64, u8, u64, u64): u64
47MoveLoc[7](loc3: u64)
48MoveLoc[9](loc5: u64)
49LdU64(100)
50Call math::mul_factor(u64, u64, u64): u64
51Ge
52Ret
}
public get_bucket_tcr<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock): u64 {
L3: loc0: u64
L4: loc1: u64
L5: loc2: u64
L6: loc3: u64
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call get_total_collateral_balance<Ty0>(&Bucket<Ty0>): u64
2CopyLoc[0](Arg0: &Bucket<Ty0>)
3ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
4ReadRef
5Add
6StLoc[3](loc0: u64)
7CopyLoc[0](Arg0: &Bucket<Ty0>)
8CopyLoc[2](Arg2: &Clock)
9Call get_bucket_debt<Ty0>(&Bucket<Ty0>, &Clock): u64
10StLoc[4](loc1: u64)
11CopyLoc[4](loc1: u64)
12LdU64(0)
13Eq
14BrFalse(23)
B1:
15MoveLoc[1](Arg1: &BucketOracle)
16Pop
17MoveLoc[2](Arg2: &Clock)
18Pop
19MoveLoc[0](Arg0: &Bucket<Ty0>)
20Pop
21Call constants::max_u64(): u64
22Ret
B2:
23MoveLoc[1](Arg1: &BucketOracle)
24MoveLoc[2](Arg2: &Clock)
25Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
26StLoc[5](loc2: u64)
27StLoc[6](loc3: u64)
28MoveLoc[3](loc0: u64)
29MoveLoc[0](Arg0: &Bucket<Ty0>)
30ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
31ReadRef
32MoveLoc[6](loc3: u64)
33MoveLoc[5](loc2: u64)
34Call compute_collateral_value_to_buck(u64, u8, u64, u64): u64
35LdU64(10000)
36MoveLoc[4](loc1: u64)
37Call math::mul_factor(u64, u64, u64): u64
38Ret
}
public get_bottle_icr<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock, Arg3: address): u64 {
L4: loc0: u64
L5: loc1: u64
L6: loc2: u64
L7: loc3: u64
L8: loc4: u64
L9: loc5: u64
L10: loc6: u64
B0:
0MoveLoc[1](Arg1: &BucketOracle)
1CopyLoc[2](Arg2: &Clock)
2Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
3StLoc[9](loc5: u64)
4StLoc[10](loc6: u64)
5CopyLoc[0](Arg0: &Bucket<Ty0>)
6Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
7BrFalse(15)
B1:
8CopyLoc[0](Arg0: &Bucket<Ty0>)
9MoveLoc[3](Arg3: address)
10MoveLoc[2](Arg2: &Clock)
11Call get_bottle_info_with_interest_by_debtor<Ty0>(&Bucket<Ty0>, address, &Clock): u64 * u64
12StLoc[5](loc1: u64)
13StLoc[4](loc0: u64)
14Branch(22)
B2:
15MoveLoc[2](Arg2: &Clock)
16Pop
17CopyLoc[0](Arg0: &Bucket<Ty0>)
18MoveLoc[3](Arg3: address)
19Call get_bottle_info_by_debtor<Ty0>(&Bucket<Ty0>, address): u64 * u64
20StLoc[5](loc1: u64)
21StLoc[4](loc0: u64)
B3:
22MoveLoc[4](loc0: u64)
23MoveLoc[5](loc1: u64)
24StLoc[7](loc3: u64)
25MoveLoc[0](Arg0: &Bucket<Ty0>)
26ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
27ReadRef
28MoveLoc[10](loc6: u64)
29MoveLoc[9](loc5: u64)
30Call compute_collateral_value_to_buck(u64, u8, u64, u64): u64
31StLoc[8](loc4: u64)
32CopyLoc[7](loc3: u64)
33LdU64(0)
34Gt
35BrFalse(42)
B4:
36MoveLoc[8](loc4: u64)
37LdU64(10000)
38MoveLoc[7](loc3: u64)
39Call math::mul_factor(u64, u64, u64): u64
40StLoc[6](loc2: u64)
41Branch(44)
B5:
42Call constants::max_u64(): u64
43StLoc[6](loc2: u64)
B6:
44MoveLoc[6](loc2: u64)
45Ret
}
public get_bottle_table_length<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Call bottle::get_table_length(&BottleTable): u64
3Ret
}
public get_collateral_vault_balance<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
2Call balance::value<Ty0>(&Balance<Ty0>): u64
3Ret
}
public get_minted_buck_amount<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
2ReadRef
3Ret
}
public get_bucket_debt<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &Clock): u64 {
L2: loc0: u256
L3: loc1: u64
L4: loc2: u256
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[2](Bucket.minted_buck_amount: u64)
2ReadRef
3StLoc[3](loc1: u64)
4CopyLoc[0](Arg0: &Bucket<Ty0>)
5Call is_interest_table_exists<Ty0>(&Bucket<Ty0>): bool
6BrFalse(37)
B1:
7MoveLoc[0](Arg0: &Bucket<Ty0>)
8Call borrow_interest_table<Ty0>(&Bucket<Ty0>): &InterestTable
9MoveLoc[1](Arg1: &Clock)
10Call interest::calculate_interest_index(&InterestTable, &Clock): u256 * u256
11StLoc[4](loc2: u256)
12Pop
13CopyLoc[4](loc2: u256)
14LdU256(0)
15Gt
16BrFalse(36)
B2:
17CopyLoc[3](loc1: u64)
18CastU256
19MoveLoc[4](loc2: u256)
20Call constants::interest_precision(): u256
21Call 0math::mul_factor_u256(u256, u256, u256): u256
22StLoc[2](loc0: u256)
23CopyLoc[2](loc0: u256)
24Call constants::max_u64(): u64
25CastU256
26Le
27BrFalse(29)
B3:
28Branch(31)
B4:
29LdConst[8](u64: 8)
30Abort
B5:
31MoveLoc[3](loc1: u64)
32MoveLoc[2](loc0: u256)
33CastU64
34Add
35StLoc[3](loc1: u64)
B6:
36Branch(41)
B7:
37MoveLoc[1](Arg1: &Clock)
38Pop
39MoveLoc[0](Arg0: &Bucket<Ty0>)
40Pop
B8:
41MoveLoc[3](loc1: u64)
42Ret
}
public get_bucket_size<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Call bottle::get_table_length(&BottleTable): u64
3Ret
}
public get_lowest_cr_debtor<Ty0>(Arg0: &Bucket<Ty0>): Option<address> {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Call bottle::get_lowest_cr_debtor(&BottleTable): Option<address>
3Ret
}
public is_liquidatable<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock, Arg3: address): bool {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1MoveLoc[1](Arg1: &BucketOracle)
2MoveLoc[2](Arg2: &Clock)
3MoveLoc[3](Arg3: address)
4Call is_healthy_bottle_by_debtor<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock, address): bool
5Not
6Ret
}
public has_liquidatable_bottle<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock): bool {
L3: loc0: Option<address>
L4: loc1: address
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call get_lowest_cr_debtor<Ty0>(&Bucket<Ty0>): Option<address>
2StLoc[3](loc0: Option<address>)
3ImmBorrowLoc[3](loc0: Option<address>)
4Call option::is_none<address>(&Option<address>): bool
5BrFalse(16)
B1:
6MoveLoc[1](Arg1: &BucketOracle)
7Pop
8MoveLoc[2](Arg2: &Clock)
9Pop
10MoveLoc[0](Arg0: &Bucket<Ty0>)
11Pop
12MoveLoc[3](loc0: Option<address>)
13Call option::destroy_none<address>(Option<address>)
14LdFalse
15Ret
B2:
16MoveLoc[3](loc0: Option<address>)
17Call option::destroy_some<address>(Option<address>): address
18StLoc[4](loc1: address)
19MoveLoc[0](Arg0: &Bucket<Ty0>)
20MoveLoc[1](Arg1: &BucketOracle)
21MoveLoc[2](Arg2: &Clock)
22MoveLoc[4](loc1: address)
23Call is_liquidatable<Ty0>(&Bucket<Ty0>, &BucketOracle, &Clock, address): bool
24Ret
}
public is_in_recovery_mode<Ty0>(Arg0: &Bucket<Ty0>, Arg1: &BucketOracle, Arg2: &Clock): bool {
L3: loc0: u64
L4: loc1: u64
L5: loc2: u64
L6: loc3: u64
B0:
0MoveLoc[1](Arg1: &BucketOracle)
1CopyLoc[2](Arg2: &Clock)
2Call bucket_oracle::get_price<Ty0>(&BucketOracle, &Clock): u64 * u64
3StLoc[5](loc2: u64)
4StLoc[6](loc3: u64)
5CopyLoc[0](Arg0: &Bucket<Ty0>)
6Call get_total_collateral_balance<Ty0>(&Bucket<Ty0>): u64
7CopyLoc[0](Arg0: &Bucket<Ty0>)
8ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
9ReadRef
10Add
11StLoc[3](loc0: u64)
12CopyLoc[0](Arg0: &Bucket<Ty0>)
13MoveLoc[2](Arg2: &Clock)
14Call get_bucket_debt<Ty0>(&Bucket<Ty0>, &Clock): u64
15StLoc[4](loc1: u64)
16MoveLoc[3](loc0: u64)
17CopyLoc[0](Arg0: &Bucket<Ty0>)
18ImmBorrowFieldGeneric[6](Bucket.collateral_decimal: u8)
19ReadRef
20MoveLoc[6](loc3: u64)
21MoveLoc[5](loc2: u64)
22Call compute_collateral_value_to_buck(u64, u8, u64, u64): u64
23MoveLoc[4](loc1: u64)
24MoveLoc[0](Arg0: &Bucket<Ty0>)
25ImmBorrowFieldGeneric[7](Bucket.recovery_mode_threshold: u64)
26ReadRef
27LdU64(100)
28Call math::mul_factor(u64, u64, u64): u64
29Le
30Ret
}
public is_interest_table_exists<Ty0>(Arg0: &Bucket<Ty0>): bool {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[0](Bucket.id: UID)
2LdConst[10](vector<u8>: "int..)
3Call dynamic_object_field::exists<vector<u8>>(&UID, vector<u8>): bool
4Ret
}
public(friend) handle_flash_borrow<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: u64): Balance<Ty0> * FlashReceipt<Ty0> {
L2: loc0: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
2ReadRef
3CopyLoc[1](Arg1: u64)
4Add
5CopyLoc[0](Arg0: &mut Bucket<Ty0>)
6MutBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
7WriteRef
8CopyLoc[1](Arg1: u64)
9Call constants::flash_loan_fee(): u64
10Call constants::fee_precision(): u64
11Call math::mul_factor(u64, u64, u64): u64
12StLoc[2](loc0: u64)
13CopyLoc[2](loc0: u64)
14LdU64(0)
15Eq
16BrFalse(19)
B1:
17LdU64(1)
18StLoc[2](loc0: u64)
B2:
19MoveLoc[0](Arg0: &mut Bucket<Ty0>)
20MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
21CopyLoc[1](Arg1: u64)
22Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
23MoveLoc[1](Arg1: u64)
24MoveLoc[2](loc0: u64)
25PackGeneric[1](FlashReceipt<Ty0>)
26Ret
}
public(friend) handle_flash_repay<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: Balance<Ty0>, Arg2: FlashReceipt<Ty0>): Balance<Ty0> {
L3: loc0: u64
L4: loc1: u64
L5: loc2: Balance<Ty0>
B0:
0MoveLoc[2](Arg2: FlashReceipt<Ty0>)
1UnpackGeneric[1](FlashReceipt<Ty0>)
2StLoc[4](loc1: u64)
3StLoc[3](loc0: u64)
4CopyLoc[0](Arg0: &mut Bucket<Ty0>)
5ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
6ReadRef
7CopyLoc[3](loc0: u64)
8Sub
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10MutBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
11WriteRef
12ImmBorrowLoc[1](Arg1: Balance<Ty0>)
13Call balance::value<Ty0>(&Balance<Ty0>): u64
14CopyLoc[3](loc0: u64)
15MoveLoc[4](loc1: u64)
16Add
17Ge
18BrFalse(20)
B1:
19Branch(24)
B2:
20MoveLoc[0](Arg0: &mut Bucket<Ty0>)
21Pop
22LdConst[2](u64: 2)
23Abort
B3:
24MutBorrowLoc[1](Arg1: Balance<Ty0>)
25MoveLoc[3](loc0: u64)
26Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
27StLoc[5](loc2: Balance<Ty0>)
28MoveLoc[0](Arg0: &mut Bucket<Ty0>)
29MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
30MoveLoc[5](loc2: Balance<Ty0>)
31Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
32Pop
33MoveLoc[1](Arg1: Balance<Ty0>)
34Ret
}
public is_not_locked<Ty0>(Arg0: &Bucket<Ty0>): bool {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
2ReadRef
3LdU64(0)
4Eq
5Ret
}
public get_total_flash_loan_amount<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[9](Bucket.total_flash_loan_amount: u64)
2ReadRef
3Ret
}
public get_receipt_info<Ty0>(Arg0: &FlashReceipt<Ty0>): u64 * u64 {
B0:
0CopyLoc[0](Arg0: &FlashReceipt<Ty0>)
1ImmBorrowFieldGeneric[10](FlashReceipt.amount: u64)
2ReadRef
3MoveLoc[0](Arg0: &FlashReceipt<Ty0>)
4ImmBorrowFieldGeneric[11](FlashReceipt.fee: u64)
5ReadRef
6Ret
}
public get_minimum_collateral_ratio<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[8](Bucket.min_collateral_ratio: u64)
2ReadRef
3Ret
}
public get_max_mint_amount<Ty0>(Arg0: &Bucket<Ty0>): Option<u64> {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[5](Bucket.max_mint_amount: Option<u64>)
2ReadRef
3Ret
}
public compute_base_rate<Ty0>(Arg0: &Bucket<Ty0>, Arg1: u64): u64 {
L2: loc0: u64
L3: loc1: u64
L4: loc2: u64
L5: loc3: u64
L6: loc4: u64
B0:
0MoveLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &Bucket<Ty0>)
2ImmBorrowFieldGeneric[12](Bucket.latest_redemption_time: u64)
3ReadRef
4Sub
5LdU64(60000)
6Div
7StLoc[3](loc1: u64)
8CopyLoc[3](loc1: u64)
9LdU64(525600000)
10Gt
11BrFalse(14)
B1:
12LdU64(525600000)
13StLoc[3](loc1: u64)
B2:
14CopyLoc[3](loc1: u64)
15LdU64(0)
16Eq
17BrFalse(22)
B3:
18MoveLoc[0](Arg0: &Bucket<Ty0>)
19ImmBorrowFieldGeneric[13](Bucket.base_fee_rate: u64)
20ReadRef
21Ret
B4:
22Call constants::decay_factor_precision(): u64
23StLoc[6](loc4: u64)
24Call constants::minute_decay_factor(): u64
25StLoc[5](loc3: u64)
26MoveLoc[3](loc1: u64)
27StLoc[4](loc2: u64)
B5:
28CopyLoc[4](loc2: u64)
29LdU64(1)
30Gt
31BrFalse(66)
B6:
32Branch(33)
B7:
33CopyLoc[4](loc2: u64)
34LdU64(2)
35Mod
36LdU64(0)
37Eq
38BrFalse(49)
B8:
39CopyLoc[5](loc3: u64)
40MoveLoc[5](loc3: u64)
41Call constants::decay_factor_precision(): u64
42Call math::mul_factor(u64, u64, u64): u64
43StLoc[5](loc3: u64)
44MoveLoc[4](loc2: u64)
45LdU8(1)
46Shr
47StLoc[4](loc2: u64)
48Branch(65)
B9:
49CopyLoc[5](loc3: u64)
50MoveLoc[6](loc4: u64)
51Call constants::decay_factor_precision(): u64
52Call math::mul_factor(u64, u64, u64): u64
53StLoc[6](loc4: u64)
54CopyLoc[5](loc3: u64)
55MoveLoc[5](loc3: u64)
56Call constants::decay_factor_precision(): u64
57Call math::mul_factor(u64, u64, u64): u64
58StLoc[5](loc3: u64)
59MoveLoc[4](loc2: u64)
60LdU64(1)
61Sub
62LdU64(2)
63Div
64StLoc[4](loc2: u64)
B10:
65Branch(28)
B11:
66MoveLoc[5](loc3: u64)
67MoveLoc[6](loc4: u64)
68Call constants::decay_factor_precision(): u64
69Call math::mul_factor(u64, u64, u64): u64
70StLoc[2](loc0: u64)
71MoveLoc[0](Arg0: &Bucket<Ty0>)
72ImmBorrowFieldGeneric[13](Bucket.base_fee_rate: u64)
73ReadRef
74MoveLoc[2](loc0: u64)
75Call constants::decay_factor_precision(): u64
76Call math::mul_factor(u64, u64, u64): u64
77Ret
}
compute_collateral_value_to_buck(Arg0: u64, Arg1: u8, Arg2: u64, Arg3: u64): u64 {
L4: loc0: u64
L5: loc1: u64
B0:
0MoveLoc[0](Arg0: u64)
1MoveLoc[2](Arg2: u64)
2MoveLoc[3](Arg3: u64)
3Call math::mul_factor(u64, u64, u64): u64
4StLoc[5](loc1: u64)
5Call constants::buck_decimal(): u8
6CopyLoc[1](Arg1: u8)
7Ge
8BrFalse(18)
B1:
9MoveLoc[5](loc1: u64)
10LdU64(10)
11Call constants::buck_decimal(): u8
12MoveLoc[1](Arg1: u8)
13Sub
14Call u64::pow(u64, u8): u64
15Mul
16StLoc[4](loc0: u64)
17Branch(26)
B2:
18MoveLoc[5](loc1: u64)
19LdU64(10)
20MoveLoc[1](Arg1: u8)
21Call constants::buck_decimal(): u8
22Sub
23Call u64::pow(u64, u8): u64
24Div
25StLoc[4](loc0: u64)
B3:
26MoveLoc[4](loc0: u64)
27Ret
}
compute_buck_value_to_collateral(Arg0: u64, Arg1: u8, Arg2: u64, Arg3: u64): u64 {
L4: loc0: u64
L5: loc1: u64
B0:
0MoveLoc[0](Arg0: u64)
1MoveLoc[3](Arg3: u64)
2MoveLoc[2](Arg2: u64)
3Call math::mul_factor(u64, u64, u64): u64
4StLoc[5](loc1: u64)
5Call constants::buck_decimal(): u8
6CopyLoc[1](Arg1: u8)
7Ge
8BrFalse(18)
B1:
9MoveLoc[5](loc1: u64)
10LdU64(10)
11Call constants::buck_decimal(): u8
12MoveLoc[1](Arg1: u8)
13Sub
14Call u64::pow(u64, u8): u64
15Div
16StLoc[4](loc0: u64)
17Branch(26)
B2:
18MoveLoc[5](loc1: u64)
19LdU64(10)
20MoveLoc[1](Arg1: u8)
21Call constants::buck_decimal(): u8
22Sub
23Call u64::pow(u64, u8): u64
24Mul
25StLoc[4](loc0: u64)
B3:
26MoveLoc[4](loc0: u64)
27Ret
}
public(friend) update_base_rate_fee<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: u64, Arg2: u64) {
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut Bucket<Ty0>)
2MutBorrowFieldGeneric[13](Bucket.base_fee_rate: u64)
3WriteRef
4MoveLoc[2](Arg2: u64)
5MoveLoc[0](Arg0: &mut Bucket<Ty0>)
6MutBorrowFieldGeneric[12](Bucket.latest_redemption_time: u64)
7WriteRef
8MoveLoc[1](Arg1: u64)
9Call bucket_events::emit_fee_rate_changed<Ty0>(u64)
10Ret
}
public(friend) update_snapshot<Ty0>(Arg0: &mut Bucket<Ty0>) {
L1: loc0: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1FreezeRef
2Call get_total_collateral_balance<Ty0>(&Bucket<Ty0>): u64
3StLoc[1](loc0: u64)
4MoveLoc[0](Arg0: &mut Bucket<Ty0>)
5MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
6MoveLoc[1](loc0: u64)
7Call bottle::update_snapshot(&mut BottleTable, u64)
8Ret
}
public(friend) withdraw_surplus_collateral<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address): Balance<Ty0> {
L2: loc0: Bottle
L3: loc1: u64
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
2CopyLoc[1](Arg1: address)
3Call table::contains<address, Bottle>(&Table<address, Bottle>, address): bool
4BrFalse(6)
B1:
5Branch(10)
B2:
6MoveLoc[0](Arg0: &mut Bucket<Ty0>)
7Pop
8LdConst[6](u64: 6)
9Abort
B3:
10CopyLoc[0](Arg0: &mut Bucket<Ty0>)
11MutBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
12CopyLoc[1](Arg1: address)
13Call table::remove<address, Bottle>(&mut Table<address, Bottle>, address): Bottle
14StLoc[2](loc0: Bottle)
15MoveLoc[1](Arg1: address)
16ImmBorrowLoc[2](loc0: Bottle)
17Call bucket_events::emit_surplus_bottle_withdrawal<Ty0>(address, &Bottle)
18MoveLoc[2](loc0: Bottle)
19Call bottle::destroy_surplus_bottle(Bottle): u64
20StLoc[3](loc1: u64)
21MoveLoc[0](Arg0: &mut Bucket<Ty0>)
22MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
23MoveLoc[3](loc1: u64)
24Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
25Ret
}
public(friend) update_max_mint_amount<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: Option<u64>) {
B0:
0MoveLoc[1](Arg1: Option<u64>)
1MoveLoc[0](Arg0: &mut Bucket<Ty0>)
2MutBorrowFieldGeneric[5](Bucket.max_mint_amount: Option<u64>)
3WriteRef
4Ret
}
public(friend) update_liquidation_config<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: u64, Arg2: u64) {
B0:
0MoveLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut Bucket<Ty0>)
2MutBorrowFieldGeneric[8](Bucket.min_collateral_ratio: u64)
3WriteRef
4MoveLoc[2](Arg2: u64)
5MoveLoc[0](Arg0: &mut Bucket<Ty0>)
6MutBorrowFieldGeneric[7](Bucket.recovery_mode_threshold: u64)
7WriteRef
8Ret
}
public get_surplus_collateral_amount<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
2MoveLoc[1](Arg1: address)
3Call table::borrow<address, Bottle>(&Table<address, Bottle>, address): &Bottle
4Call bottle::get_bottle_raw_info(&Bottle): u64 * u64
5Pop
6Ret
}
public get_surplus_bottle_table_size<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1Call borrow_surplus_bottle_table<Ty0>(&Bucket<Ty0>): &Table<address, Bottle>
2Call table::length<address, Bottle>(&Table<address, Bottle>): u64
3Ret
}
public borrow_bottle_table<Ty0>(Arg0: &Bucket<Ty0>): &BottleTable {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Ret
}
public borrow_surplus_bottle_table<Ty0>(Arg0: &Bucket<Ty0>): &Table<address, Bottle> {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
2Ret
}
public borrow_pending_record<Ty0>(Arg0: &Bucket<Ty0>): &PendingRecord {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[0](Bucket.id: UID)
2LdConst[9](vector<u8>: "pen..)
3Call dynamic_object_field::borrow<vector<u8>, PendingRecord>(&UID, vector<u8>): &PendingRecord
4Ret
}
public(friend) borrow_pending_record_mut<Ty0>(Arg0: &mut Bucket<Ty0>): &mut PendingRecord {
B0:
0MoveLoc[0](Arg0: &mut Bucket<Ty0>)
1MutBorrowFieldGeneric[0](Bucket.id: UID)
2LdConst[9](vector<u8>: "pen..)
3Call dynamic_object_field::borrow_mut<vector<u8>, PendingRecord>(&mut UID, vector<u8>): &mut PendingRecord
4Ret
}
public get_bucket_pending_debt<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1Call borrow_pending_record<Ty0>(&Bucket<Ty0>): &PendingRecord
2ImmBorrowField[3](PendingRecord.bucket_pending_debt: u64)
3ReadRef
4Ret
}
public get_bucket_pending_collateral<Ty0>(Arg0: &Bucket<Ty0>): u64 {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1Call borrow_pending_record<Ty0>(&Bucket<Ty0>): &PendingRecord
2ImmBorrowField[15](PendingRecord.bucket_pending_collateral: u64)
3ReadRef
4Ret
}
public prev_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): &Option<address> {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Call bottle::borrow_table(&BottleTable): &LinkedTable<address, Bottle>
3MoveLoc[1](Arg1: address)
4Call linked_table::prev<address, Bottle>(&LinkedTable<address, Bottle>, address): &Option<address>
5Ret
}
public next_debtor<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address): &Option<address> {
B0:
0MoveLoc[0](Arg0: &Bucket<Ty0>)
1ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
2Call bottle::borrow_table(&BottleTable): &LinkedTable<address, Bottle>
3MoveLoc[1](Arg1: address)
4Call linked_table::next<address, Bottle>(&LinkedTable<address, Bottle>, address): &Option<address>
5Ret
}
apply_pending<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address): u64 * u64 {
L2: loc0: u64
L3: loc1: u64
L4: loc2: &Bottle
L5: loc3: u64
L6: loc4: u64
L7: loc5: &mut PendingRecord
L8: loc6: &BottleTable
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1ImmBorrowFieldGeneric[0](Bucket.id: UID)
2LdConst[9](vector<u8>: "pen..)
3Call dynamic_object_field::exists_with_type<vector<u8>, PendingRecord>(&UID, vector<u8>): bool
4BrFalse(62)
B1:
5CopyLoc[0](Arg0: &mut Bucket<Ty0>)
6FreezeRef
7Call borrow_bottle_table<Ty0>(&Bucket<Ty0>): &BottleTable
8StLoc[8](loc6: &BottleTable)
9CopyLoc[8](loc6: &BottleTable)
10CopyLoc[1](Arg1: address)
11Call bottle::borrow_bottle(&BottleTable, address): &Bottle
12StLoc[4](loc2: &Bottle)
13CopyLoc[4](loc2: &Bottle)
14CopyLoc[8](loc6: &BottleTable)
15Call bottle::get_pending_coll(&Bottle, &BottleTable): u64
16StLoc[5](loc3: u64)
17MoveLoc[4](loc2: &Bottle)
18MoveLoc[8](loc6: &BottleTable)
19Call bottle::get_pending_debt(&Bottle, &BottleTable): u64
20StLoc[6](loc4: u64)
21CopyLoc[0](Arg0: &mut Bucket<Ty0>)
22Call borrow_pending_record_mut<Ty0>(&mut Bucket<Ty0>): &mut PendingRecord
23StLoc[7](loc5: &mut PendingRecord)
24CopyLoc[7](loc5: &mut PendingRecord)
25ImmBorrowField[15](PendingRecord.bucket_pending_collateral: u64)
26ReadRef
27CopyLoc[5](loc3: u64)
28Ge
29BrFalse(37)
B2:
30CopyLoc[7](loc5: &mut PendingRecord)
31ImmBorrowField[15](PendingRecord.bucket_pending_collateral: u64)
32ReadRef
33MoveLoc[5](loc3: u64)
34Sub
35StLoc[2](loc0: u64)
36Branch(39)
B3:
37LdU64(0)
38StLoc[2](loc0: u64)
B4:
39MoveLoc[2](loc0: u64)
40CopyLoc[7](loc5: &mut PendingRecord)
41MutBorrowField[15](PendingRecord.bucket_pending_collateral: u64)
42WriteRef
43CopyLoc[7](loc5: &mut PendingRecord)
44ImmBorrowField[3](PendingRecord.bucket_pending_debt: u64)
45ReadRef
46CopyLoc[6](loc4: u64)
47Ge
48BrFalse(56)
B5:
49CopyLoc[7](loc5: &mut PendingRecord)
50ImmBorrowField[3](PendingRecord.bucket_pending_debt: u64)
51ReadRef
52MoveLoc[6](loc4: u64)
53Sub
54StLoc[3](loc1: u64)
55Branch(58)
B6:
56LdU64(0)
57StLoc[3](loc1: u64)
B7:
58MoveLoc[3](loc1: u64)
59MoveLoc[7](loc5: &mut PendingRecord)
60MutBorrowField[3](PendingRecord.bucket_pending_debt: u64)
61WriteRef
B8:
62MoveLoc[0](Arg0: &mut Bucket<Ty0>)
63MutBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
64MoveLoc[1](Arg1: address)
65Call bottle::get_bottle_info_after_update(&mut BottleTable, address): u64 * u64
66Ret
}
public(friend) adjust_pending_record<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: u64, Arg2: u64) {
L3: loc0: &mut PendingRecord
B0:
0MoveLoc[0](Arg0: &mut Bucket<Ty0>)
1Call borrow_pending_record_mut<Ty0>(&mut Bucket<Ty0>): &mut PendingRecord
2StLoc[3](loc0: &mut PendingRecord)
3MoveLoc[1](Arg1: u64)
4CopyLoc[3](loc0: &mut PendingRecord)
5MutBorrowField[15](PendingRecord.bucket_pending_collateral: u64)
6WriteRef
7MoveLoc[2](Arg2: u64)
8MoveLoc[3](loc0: &mut PendingRecord)
9MutBorrowField[3](PendingRecord.bucket_pending_debt: u64)
10WriteRef
11Ret
}
public destroy_empty_strap<Ty0>(Arg0: &Bucket<Ty0>, Arg1: BottleStrap<Ty0>) {
L2: loc0: bool
L3: loc1: address
B0:
0ImmBorrowLoc[1](Arg1: BottleStrap<Ty0>)
1Call strap::get_address<Ty0>(&BottleStrap<Ty0>): address
2StLoc[3](loc1: address)
3CopyLoc[0](Arg0: &Bucket<Ty0>)
4CopyLoc[3](loc1: address)
5Call bottle_exists<Ty0>(&Bucket<Ty0>, address): bool
6Not
7BrFalse(15)
B1:
8MoveLoc[0](Arg0: &Bucket<Ty0>)
9ImmBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
10MoveLoc[3](loc1: address)
11Call table::contains<address, Bottle>(&Table<address, Bottle>, address): bool
12Not
13StLoc[2](loc0: bool)
14Branch(19)
B2:
15MoveLoc[0](Arg0: &Bucket<Ty0>)
16Pop
17LdFalse
18StLoc[2](loc0: bool)
B3:
19MoveLoc[2](loc0: bool)
20BrFalse(22)
B4:
21Branch(24)
B5:
22LdConst[8](u64: 8)
23Abort
B6:
24MoveLoc[1](Arg1: BottleStrap<Ty0>)
25Call strap::destroy<Ty0>(BottleStrap<Ty0>)
26Ret
}
public(friend) output<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: u64): Balance<Ty0> {
L2: loc0: OutputKey
L3: loc1: &mut OutputVolume
B0:
0LdFalse
1Pack[3](OutputKey)
2StLoc[2](loc0: OutputKey)
3CopyLoc[0](Arg0: &mut Bucket<Ty0>)
4ImmBorrowFieldGeneric[0](Bucket.id: UID)
5CopyLoc[2](loc0: OutputKey)
6Call dynamic_field::exists_with_type<OutputKey, OutputVolume>(&UID, OutputKey): bool
7Not
8BrFalse(15)
B1:
9CopyLoc[0](Arg0: &mut Bucket<Ty0>)
10MutBorrowFieldGeneric[0](Bucket.id: UID)
11CopyLoc[2](loc0: OutputKey)
12LdU64(0)
13Pack[4](OutputVolume)
14Call dynamic_field::add<OutputKey, OutputVolume>(&mut UID, OutputKey, OutputVolume)
B2:
15CopyLoc[0](Arg0: &mut Bucket<Ty0>)
16MutBorrowFieldGeneric[0](Bucket.id: UID)
17MoveLoc[2](loc0: OutputKey)
18Call dynamic_field::borrow_mut<OutputKey, OutputVolume>(&mut UID, OutputKey): &mut OutputVolume
19StLoc[3](loc1: &mut OutputVolume)
20CopyLoc[3](loc1: &mut OutputVolume)
21ImmBorrowField[16](OutputVolume.volume: u64)
22ReadRef
23CopyLoc[1](Arg1: u64)
24Add
25MoveLoc[3](loc1: &mut OutputVolume)
26MutBorrowField[16](OutputVolume.volume: u64)
27WriteRef
28MoveLoc[0](Arg0: &mut Bucket<Ty0>)
29MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
30MoveLoc[1](Arg1: u64)
31Call balance::split<Ty0>(&mut Balance<Ty0>, u64): Balance<Ty0>
32Ret
}
public(friend) input<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: Balance<Ty0>) {
L2: loc0: u64
L3: loc1: &mut OutputVolume
B0:
0CopyLoc[0](Arg0: &mut Bucket<Ty0>)
1MutBorrowFieldGeneric[0](Bucket.id: UID)
2LdFalse
3Pack[3](OutputKey)
4Call dynamic_field::borrow_mut<OutputKey, OutputVolume>(&mut UID, OutputKey): &mut OutputVolume
5StLoc[3](loc1: &mut OutputVolume)
6ImmBorrowLoc[1](Arg1: Balance<Ty0>)
7Call balance::value<Ty0>(&Balance<Ty0>): u64
8StLoc[2](loc0: u64)
9CopyLoc[3](loc1: &mut OutputVolume)
10ImmBorrowField[16](OutputVolume.volume: u64)
11ReadRef
12MoveLoc[2](loc0: u64)
13Sub
14MoveLoc[3](loc1: &mut OutputVolume)
15MutBorrowField[16](OutputVolume.volume: u64)
16WriteRef
17MoveLoc[0](Arg0: &mut Bucket<Ty0>)
18MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
19MoveLoc[1](Arg1: Balance<Ty0>)
20Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
21Pop
22Ret
}
public get_collateral_output_volume<Ty0>(Arg0: &Bucket<Ty0>): u64 {
L1: loc0: u64
L2: loc1: OutputKey
B0:
0LdFalse
1Pack[3](OutputKey)
2StLoc[2](loc1: OutputKey)
3CopyLoc[0](Arg0: &Bucket<Ty0>)
4ImmBorrowFieldGeneric[0](Bucket.id: UID)
5CopyLoc[2](loc1: OutputKey)
6Call dynamic_field::exists_with_type<OutputKey, OutputVolume>(&UID, OutputKey): bool
7BrFalse(16)
B1:
8MoveLoc[0](Arg0: &Bucket<Ty0>)
9ImmBorrowFieldGeneric[0](Bucket.id: UID)
10MoveLoc[2](loc1: OutputKey)
11Call dynamic_field::borrow<OutputKey, OutputVolume>(&UID, OutputKey): &OutputVolume
12ImmBorrowField[16](OutputVolume.volume: u64)
13ReadRef
14StLoc[1](loc0: u64)
15Branch(20)
B2:
16MoveLoc[0](Arg0: &Bucket<Ty0>)
17Pop
18LdU64(0)
19StLoc[1](loc0: u64)
B3:
20MoveLoc[1](loc0: u64)
21Ret
}
public get_total_collateral_balance<Ty0>(Arg0: &Bucket<Ty0>): u64 {
L1: loc0: u64
L2: loc1: u64
B0:
0CopyLoc[0](Arg0: &Bucket<Ty0>)
1Call get_collateral_vault_balance<Ty0>(&Bucket<Ty0>): u64
2StLoc[2](loc1: u64)
3MoveLoc[0](Arg0: &Bucket<Ty0>)
4Call get_collateral_output_volume<Ty0>(&Bucket<Ty0>): u64
5StLoc[1](loc0: u64)
6MoveLoc[2](loc1: u64)
7MoveLoc[1](loc0: u64)
8Add
9Ret
}
public(friend) handle_deposit_surplus<Ty0>(Arg0: &mut Bucket<Ty0>, Arg1: address, Arg2: Balance<Ty0>, Arg3: &mut TxContext) {
L4: loc0: address
L5: loc1: Bottle
L6: loc2: u64
L7: loc3: &mut Table<address, Bottle>
B0:
0ImmBorrowLoc[2](Arg2: Balance<Ty0>)
1Call balance::value<Ty0>(&Balance<Ty0>): u64
2StLoc[6](loc2: u64)
3CopyLoc[0](Arg0: &mut Bucket<Ty0>)
4MutBorrowFieldGeneric[3](Bucket.surplus_bottle_table: Table<address, Bottle>)
5StLoc[7](loc3: &mut Table<address, Bottle>)
6CopyLoc[7](loc3: &mut Table<address, Bottle>)
7CopyLoc[1](Arg1: address)
8StLoc[4](loc0: address)
9FreezeRef
10MoveLoc[4](loc0: address)
11Call table::contains<address, Bottle>(&Table<address, Bottle>, address): bool
12BrFalse(21)
B1:
13MoveLoc[3](Arg3: &mut TxContext)
14Pop
15MoveLoc[7](loc3: &mut Table<address, Bottle>)
16MoveLoc[1](Arg1: address)
17Call table::borrow_mut<address, Bottle>(&mut Table<address, Bottle>, address): &mut Bottle
18MoveLoc[6](loc2: u64)
19Call bottle::record_top_up(&mut Bottle, u64)
20Branch(29)
B2:
21MoveLoc[6](loc2: u64)
22MoveLoc[3](Arg3: &mut TxContext)
23Call bottle::new_surplus_bottle(u64, &mut TxContext): Bottle
24StLoc[5](loc1: Bottle)
25MoveLoc[7](loc3: &mut Table<address, Bottle>)
26MoveLoc[1](Arg1: address)
27MoveLoc[5](loc1: Bottle)
28Call table::add<address, Bottle>(&mut Table<address, Bottle>, address, Bottle)
B3:
29MoveLoc[0](Arg0: &mut Bucket<Ty0>)
30MutBorrowFieldGeneric[4](Bucket.collateral_vault: Balance<Ty0>)
31MoveLoc[2](Arg2: Balance<Ty0>)
32Call balance::join<Ty0>(&mut Balance<Ty0>, Balance<Ty0>): u64
33Pop
34Ret
}
check_insertion_place<Ty0>(Arg0: &Bucket<Ty0>, Arg1: address, Arg2: &mut Option<address>) {
L3: loc0: bool
L4: loc1: Option<address>
B0:
0CopyLoc[2](Arg2: &mut Option<address>)
1FreezeRef
2Call option::is_some<address>(&Option<address>): bool
3BrFalse(12)
B1:
4CopyLoc[2](Arg2: &mut Option<address>)
5FreezeRef
6Call option::borrow<address>(&Option<address>): &address
7ReadRef
8CopyLoc[1](Arg1: address)
9Eq
10StLoc[3](loc0: bool)
11Branch(14)
B2:
12LdFalse
13StLoc[3](loc0: bool)
B3:
14MoveLoc[3](loc0: bool)
15BrFalse(36)
B4:
16MoveLoc[0](Arg0: &Bucket<Ty0>)
17ImmBorrowFieldGeneric[1](Bucket.bottle_table: BottleTable)
18Call bottle::borrow_table(&BottleTable): &LinkedTable<address, Bottle>
19MoveLoc[1](Arg1: address)
20Call linked_table::prev<address, Bottle>(&LinkedTable<address, Bottle>, address): &Option<address>
21ReadRef
22StLoc[4](loc1: Option<address>)
23ImmBorrowLoc[4](loc1: Option<address>)
24Call option::is_none<address>(&Option<address>): bool
25BrFalse(30)
B5:
26MoveLoc[2](Arg2: &mut Option<address>)
27Call option::extract<address>(&mut Option<address>): address
28Pop
29Branch(35)
B6:
30MoveLoc[2](Arg2: &mut Option<address>)
31MoveLoc[4](loc1: Option<address>)
32Call option::destroy_some<address>(Option<address>): address
33Call option::swap<address>(&mut Option<address>, address): address
34Pop
B7:
35Branch(40)
B8:
36MoveLoc[2](Arg2: &mut Option<address>)
37Pop
38MoveLoc[0](Arg0: &Bucket<Ty0>)
39Pop
B9:
40Ret
}
Constants [
0 => u64: 0
1 => u64: 1
2 => u64: 2
3 => u64: 3
4 => u64: 4
5 => u64: 5
6 => u64: 6
7 => u64: 7
8 => u64: 8
9 => vector<u8>: "pending_record" // interpreted as UTF8 string
10 => vector<u8>: "interest_table" // interpreted as UTF8 string
]
}