package tezos-protocol-alpha
This module is responsible for maintaining the Storage.Contract.Frozen_deposits_pseudotokens
and Storage.Contract.Staking_pseudotokens
tables.
val stake :
Raw_context.t ->
contract:Contract_repr.t ->
delegate:Tezos_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
stake ctxt ~contract ~delegate amount
credits the contract
's staking pseudotokens and the delegate
's frozen deposits pseudotokens by an amount of pseudotokens corresponding to amount
using delegate
's staked frozen deposits pseudotokens/tez rate.
This function must be called on "stake" **before** transferring tez to delegate
's frozen deposits.
delegate
must be contract
's delegate.
val request_unstake :
Raw_context.t ->
contract:Contract_repr.t ->
delegate:Tezos_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t ->
(Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates)
Tezos_protocol_environment_alpha.Error_monad.tzresult
Tezos_protocol_environment_alpha.Lwt.t
request_unstake ctxt ~contract ~delegate amount
debits the contract
's staking pseudotokens and the delegate
's frozen deposits pseudotokens by an amount of pseudotokens corresponding to amount
using delegate
's staked frozen deposits pseudotokens/tez rate capped by contract
's staking pseudotokens balance.
It returns the tez amount corresponding to the debited pseudotokens.
Resulting context do not make sense if delegate
is not contract
's delegate.
module For_RPC : sig ... end