Module Mavryk_raw_protocol_alpha.Staking_pseudotokens_storage

This module is responsible for maintaining the Storage.Contract.Frozen_deposits_pseudotokens and Storage.Contract.Staking_pseudotokens tables.

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/mav rate.

This function must be called on "stake" **before** transferring mav to delegate's frozen deposits.

delegate must be contract's delegate.

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/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