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

API

slashing

Module0xa9ac…bf1e
Move path
0xfdc8…ea77::slashing
Functions
63 public, 0 entry
Structs
2
Friend modules
None
slashing

Bytecode306 lines

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

// Move bytecode v7
module fdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77.slashing {
use 0000000000000000000000000000000000000000000000000000000000000001::vector;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::table;
use 0000000000000000000000000000000000000000000000000000000000000002::transfer;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
use 0000000000000000000000000000000000000000000000000000000000000002::vec_set;
use 356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal;
use fdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::auth;
use fdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::staking;
 
struct SlashingProposal has drop, store {
epoch: u32,
node_id: ID,
voting_weight: u16,
voters: VecSet<ID>
}
 
struct SlashingManager has key {
id: UID,
slashing_candidates: Table<ID, SlashingProposal>
}
 
public(friend) new(Arg0: &mut TxContext) {
B0:
0CopyLoc[0](Arg0: &mut TxContext)
1Call object::new(&mut TxContext): UID
2MoveLoc[0](Arg0: &mut TxContext)
3Call table::new<ID, SlashingProposal>(&mut TxContext): Table<ID, SlashingProposal>
4Pack[1](SlashingManager)
5Call transfer::share_object<SlashingManager>(SlashingManager)
6Ret
}
 
public vote_for_slashing(Arg0: &mut SlashingManager, Arg1: &Staking, Arg2: Authenticated, Arg3: ID, Arg4: ID) {
L5: loc0: &mut SlashingProposal
L6: loc1: u32
L7: loc2: &mut SlashingProposal
L8: loc3: SlashingProposal
L9: loc4: u16
B0:
0CopyLoc[1](Arg1: &Staking)
1CopyLoc[3](Arg3: ID)
2MoveLoc[2](Arg2: Authenticated)
3Call staking::check_governance_authorization(&Staking, ID, Authenticated): bool
4BrFalse(6)
B1:
5Branch(12)
B2:
6MoveLoc[1](Arg1: &Staking)
7Pop
8MoveLoc[0](Arg0: &mut SlashingManager)
9Pop
10LdConst[0](u64: 0)
11Abort
B3:
12CopyLoc[1](Arg1: &Staking)
13CopyLoc[3](Arg3: ID)
14Call staking::get_current_node_weight(&Staking, ID): u16
15StLoc[9](loc4: u16)
16MoveLoc[1](Arg1: &Staking)
17Call staking::epoch(&Staking): u32
18StLoc[6](loc1: u32)
19CopyLoc[0](Arg0: &mut SlashingManager)
20ImmBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
21CopyLoc[4](Arg4: ID)
22Call table::contains<ID, SlashingProposal>(&Table<ID, SlashingProposal>, ID): bool
23BrFalse(43)
B4:
24MoveLoc[0](Arg0: &mut SlashingManager)
25MutBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
26CopyLoc[4](Arg4: ID)
27Call table::borrow_mut<ID, SlashingProposal>(&mut Table<ID, SlashingProposal>, ID): &mut SlashingProposal
28StLoc[7](loc2: &mut SlashingProposal)
29CopyLoc[7](loc2: &mut SlashingProposal)
30ImmBorrowField[1](SlashingProposal.epoch: u32)
31ReadRef
32CopyLoc[6](loc1: u32)
33Neq
34BrFalse(40)
B5:
35MoveLoc[6](loc1: u32)
36MoveLoc[4](Arg4: ID)
37Call fresh_proposal(u32, ID): SlashingProposal
38CopyLoc[7](loc2: &mut SlashingProposal)
39WriteRef
B6:
40MoveLoc[7](loc2: &mut SlashingProposal)
41StLoc[5](loc0: &mut SlashingProposal)
42Branch(57)
B7:
43MoveLoc[6](loc1: u32)
44CopyLoc[4](Arg4: ID)
45Call fresh_proposal(u32, ID): SlashingProposal
46StLoc[8](loc3: SlashingProposal)
47CopyLoc[0](Arg0: &mut SlashingManager)
48MutBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
49CopyLoc[4](Arg4: ID)
50MoveLoc[8](loc3: SlashingProposal)
51Call table::add<ID, SlashingProposal>(&mut Table<ID, SlashingProposal>, ID, SlashingProposal)
52MoveLoc[0](Arg0: &mut SlashingManager)
53MutBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
54MoveLoc[4](Arg4: ID)
55Call table::borrow_mut<ID, SlashingProposal>(&mut Table<ID, SlashingProposal>, ID): &mut SlashingProposal
56StLoc[5](loc0: &mut SlashingProposal)
B8:
57MoveLoc[5](loc0: &mut SlashingProposal)
58MoveLoc[3](Arg3: ID)
59MoveLoc[9](loc4: u16)
60Call add_vote(&mut SlashingProposal, ID, u16)
61Ret
}
 
public execute_slashing(Arg0: &mut SlashingManager, Arg1: &mut Staking, Arg2: &mut ProtectedTreasury, Arg3: ID, Arg4: &mut TxContext) {
L5: loc0: SlashingProposal
B0:
0CopyLoc[0](Arg0: &mut SlashingManager)
1ImmBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
2CopyLoc[3](Arg3: ID)
3Call table::contains<ID, SlashingProposal>(&Table<ID, SlashingProposal>, ID): bool
4BrFalse(6)
B1:
5Branch(16)
B2:
6MoveLoc[2](Arg2: &mut ProtectedTreasury)
7Pop
8MoveLoc[1](Arg1: &mut Staking)
9Pop
10MoveLoc[0](Arg0: &mut SlashingManager)
11Pop
12MoveLoc[4](Arg4: &mut TxContext)
13Pop
14LdConst[2](u64: 2)
15Abort
B3:
16MoveLoc[0](Arg0: &mut SlashingManager)
17MutBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
18CopyLoc[3](Arg3: ID)
19Call table::remove<ID, SlashingProposal>(&mut Table<ID, SlashingProposal>, ID): SlashingProposal
20StLoc[5](loc0: SlashingProposal)
21ImmBorrowLoc[5](loc0: SlashingProposal)
22ImmBorrowField[1](SlashingProposal.epoch: u32)
23ReadRef
24CopyLoc[1](Arg1: &mut Staking)
25FreezeRef
26Call staking::epoch(&Staking): u32
27Eq
28BrFalse(30)
B4:
29Branch(38)
B5:
30MoveLoc[2](Arg2: &mut ProtectedTreasury)
31Pop
32MoveLoc[1](Arg1: &mut Staking)
33Pop
34MoveLoc[4](Arg4: &mut TxContext)
35Pop
36LdConst[3](u64: 3)
37Abort
B6:
38CopyLoc[1](Arg1: &mut Staking)
39FreezeRef
40ImmBorrowLoc[5](loc0: SlashingProposal)
41ImmBorrowField[2](SlashingProposal.voting_weight: u16)
42ReadRef
43Call staking::is_quorum(&Staking, u16): bool
44BrFalse(46)
B7:
45Branch(54)
B8:
46MoveLoc[2](Arg2: &mut ProtectedTreasury)
47Pop
48MoveLoc[1](Arg1: &mut Staking)
49Pop
50MoveLoc[4](Arg4: &mut TxContext)
51Pop
52LdConst[4](u64: 4)
53Abort
B9:
54MoveLoc[1](Arg1: &mut Staking)
55MoveLoc[3](Arg3: ID)
56MoveLoc[2](Arg2: &mut ProtectedTreasury)
57MoveLoc[4](Arg4: &mut TxContext)
58Call staking::burn_commission(&mut Staking, ID, &mut ProtectedTreasury, &mut TxContext)
59Ret
}
 
public cleanup_slashing_proposals(Arg0: &mut SlashingManager, Arg1: &Staking, Arg2: vector<ID>) {
L3: loc0: u64
L4: loc1: u32
L5: loc2: u64
L6: loc3: ID
L7: loc4: u64
L8: loc5: vector<ID>
B0:
0MoveLoc[1](Arg1: &Staking)
1Call staking::epoch(&Staking): u32
2StLoc[4](loc1: u32)
3MoveLoc[2](Arg2: vector<ID>)
4StLoc[8](loc5: vector<ID>)
5MutBorrowLoc[8](loc5: vector<ID>)
6Call vector::reverse<ID>(&mut vector<ID>)
7ImmBorrowLoc[8](loc5: vector<ID>)
8VecLen(28)
9StLoc[3](loc0: u64)
10LdU64(0)
11StLoc[5](loc2: u64)
12MoveLoc[3](loc0: u64)
13StLoc[7](loc4: u64)
B1:
14CopyLoc[5](loc2: u64)
15CopyLoc[7](loc4: u64)
16Lt
17BrFalse(47)
B2:
18CopyLoc[5](loc2: u64)
19Pop
20MutBorrowLoc[8](loc5: vector<ID>)
21VecPopBack(28)
22StLoc[6](loc3: ID)
23CopyLoc[0](Arg0: &mut SlashingManager)
24ImmBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
25CopyLoc[6](loc3: ID)
26Call table::contains<ID, SlashingProposal>(&Table<ID, SlashingProposal>, ID): bool
27BrFalse(42)
B3:
28CopyLoc[0](Arg0: &mut SlashingManager)
29ImmBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
30CopyLoc[6](loc3: ID)
31Call table::borrow<ID, SlashingProposal>(&Table<ID, SlashingProposal>, ID): &SlashingProposal
32ImmBorrowField[1](SlashingProposal.epoch: u32)
33ReadRef
34CopyLoc[4](loc1: u32)
35Lt
36BrFalse(42)
B4:
37CopyLoc[0](Arg0: &mut SlashingManager)
38MutBorrowField[0](SlashingManager.slashing_candidates: Table<ID, SlashingProposal>)
39MoveLoc[6](loc3: ID)
40Call table::remove<ID, SlashingProposal>(&mut Table<ID, SlashingProposal>, ID): SlashingProposal
41Pop
B5:
42MoveLoc[5](loc2: u64)
43LdU64(1)
44Add
45StLoc[5](loc2: u64)
46Branch(14)
B6:
47MoveLoc[0](Arg0: &mut SlashingManager)
48Pop
49MoveLoc[8](loc5: vector<ID>)
50VecUnpack(28, 0)
51Ret
}
 
fresh_proposal(Arg0: u32, Arg1: ID): SlashingProposal {
B0:
0MoveLoc[0](Arg0: u32)
1MoveLoc[1](Arg1: ID)
2LdU16(0)
3Call vec_set::empty<ID>(): VecSet<ID>
4Pack[0](SlashingProposal)
5Ret
}
 
add_vote(Arg0: &mut SlashingProposal, Arg1: ID, Arg2: u16) {
B0:
0CopyLoc[0](Arg0: &mut SlashingProposal)
1ImmBorrowField[3](SlashingProposal.voters: VecSet<ID>)
2ImmBorrowLoc[1](Arg1: ID)
3Call vec_set::contains<ID>(&VecSet<ID>, &ID): bool
4Not
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut SlashingProposal)
8Pop
9LdConst[1](u64: 1)
10Abort
B3:
11CopyLoc[0](Arg0: &mut SlashingProposal)
12MutBorrowField[3](SlashingProposal.voters: VecSet<ID>)
13MoveLoc[1](Arg1: ID)
14Call vec_set::insert<ID>(&mut VecSet<ID>, ID)
15CopyLoc[0](Arg0: &mut SlashingProposal)
16ImmBorrowField[2](SlashingProposal.voting_weight: u16)
17ReadRef
18MoveLoc[2](Arg2: u16)
19Add
20MoveLoc[0](Arg0: &mut SlashingProposal)
21MutBorrowField[2](SlashingProposal.voting_weight: u16)
22WriteRef
23Ret
}
 
Constants [
0 => u64: 0
1 => u64: 1
2 => u64: 2
3 => u64: 3
4 => u64: 4
]
}