Mavryk_raw_protocol_alpha.Staking_pseudotokens_storageThis 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:Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t ->
(Raw_context.t * Receipt_repr.balance_updates)
Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tstake 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/mav rate.
This function must be called on "stake" **before** transferring mav to delegate's frozen deposits.
delegate must be contract's delegate.
val request_unstake :
Raw_context.t ->
contract:Contract_repr.t ->
delegate:Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t ->
(Raw_context.t * Tez_repr.t * Receipt_repr.balance_updates)
Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.trequest_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/mav rate capped by contract's staking pseudotokens balance.
It returns the mav amount corresponding to the debited pseudotokens.
Resulting context do not make sense if delegate is not contract's delegate.
module For_RPC : sig ... end