Alpha_context.Staking
val stake :
context ->
amount:[ `At_most of Tez.t | `Exactly of Tez.t ] ->
sender:public_key_hash ->
delegate:public_key_hash ->
(context * Receipt.balance_updates)
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
stake ctxt ~sender ~delegate amount
add amount
as sender
's stake to delegate
.
val request_unstake :
context ->
sender_contract:Contract.t ->
delegate:public_key_hash ->
Tez.t ->
(context * Receipt.balance_updates)
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
request_unstake ctxt ~sender_contract ~delegate amount
records a request from sender_contract
to unstake amount
from delegate
.
val finalize_unstake :
context ->
Contract.t ->
(context * Receipt.balance_updates)
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t
finalize_unstake ctxt contract
performs the finalization of all unstake requests from contract
that can be finalized. An unstake request can be finalized if it is old enough, specifically the requested amount must not be at stake anymore and must not be slashable anymore, i.e. after preserved_cycles + max_slashing_period
after the request. Amounts are transferred from the contract
's delegate (at request time) unstaked frozen deposits to contract
's spendable balance, minus slashing the requested stake undergone in between.
val check_manual_staking_allowed :
context ->
unit Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Staking can be either automated or manual. If Adaptive Issuance is enabled, staking must be manual.