Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aptos-move/framework/aptos-framework/doc/staking_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,10 @@ Allows staker to switch operator without going through the lenghthy process to u
<b>let</b> staker_address = <a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of">signer::address_of</a>(staker);
<a href="staking_contract.md#0x1_staking_contract_assert_staking_contract_exists">assert_staking_contract_exists</a>(staker_address, old_operator);

<b>assert</b>!(
new_commission_percentage &lt;= 100,
<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="staking_contract.md#0x1_staking_contract_EINVALID_COMMISSION_PERCENTAGE">EINVALID_COMMISSION_PERCENTAGE</a>),
);
// Merging two existing staking contracts is too complex <b>as</b> we'd need <b>to</b> merge two separate <a href="stake.md#0x1_stake">stake</a> pools.
<b>let</b> store = <b>borrow_global_mut</b>&lt;<a href="staking_contract.md#0x1_staking_contract_Store">Store</a>&gt;(staker_address);
<b>let</b> staking_contracts = &<b>mut</b> store.staking_contracts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ module aptos_framework::staking_contract {
let staker_address = signer::address_of(staker);
assert_staking_contract_exists(staker_address, old_operator);

assert!(
new_commission_percentage <= 100,
error::invalid_argument(EINVALID_COMMISSION_PERCENTAGE),
);
// Merging two existing staking contracts is too complex as we'd need to merge two separate stake pools.
let store = borrow_global_mut<Store>(staker_address);
let staking_contracts = &mut store.staking_contracts;
Expand Down
Loading