package tezos-protocol-alpha
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/tezos_raw_protocol_alpha/Tezos_raw_protocol_alpha/Staking/index.html
Module Tezos_raw_protocol_alpha.Staking
Source
val stake :
Raw_context.t ->
for_next_cycle_use_only_after_slashing:bool ->
amount:[ `At_most of Tez_repr.t | `Exactly of Tez_repr.t ] ->
sender:Tezos_protocol_environment_alpha.Signature.Public_key_hash.t ->
delegate:Tezos_protocol_environment_alpha.Signature.public_key_hash ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
stake ctxt ~sender ~for_next_cycle_use_only_after_slashing ~delegate amount
add amount
as sender
's stake to delegate
.
If for_next_cycle_use_only_after_slashing
is true, the implicit finalisation is done for the next cycle. It is meant to be used only at cycle end after the application of the slashing.
val request_unstake :
Raw_context.t ->
for_next_cycle_use_only_after_slashing:bool ->
sender_contract:Contract_repr.t ->
delegate:Tezos_protocol_environment_alpha.Signature.public_key_hash ->
Tez_repr.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
request_unstake ctxt ~for_next_cycle_use_only_after_slashing ~sender_contract ~delegate amount
records a request from sender_contract
to unstake amount
from delegate
.
If for_next_cycle_use_only_after_slashing
is true, the unstake request and the implicit finalisation is done for the next cycle. It is meant to be used only at cycle end after the application of the slashing.
val finalize_unstake :
Raw_context.t ->
for_next_cycle_use_only_after_slashing:bool ->
Contract_repr.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
finalize_unstake ctxt ~for_next_cycle_use_only_after_slashing 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 consensus_rights_delay + 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.
If for_next_cycle_use_only_after_slashing
is true, the finalization is done for the next cycle. It is meant to be used only at cycle end after the application of the slashing.
Staking can be either automated or manual. If Adaptive Issuance is enabled, staking must be manual.
val check_manual_staking_allowed :
Raw_context.t ->
unit Tezos_protocol_environment_alpha.Error_monad.tzresult