package tezos-protocol-005-PsBabyM1

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type balance =
  1. | Contract of Contract_repr.t

Places where tezzies can be found in the ledger's state.

type balance_update =
  1. | Debited of Tez_repr.t
  2. | Credited of Tez_repr.t

A credit or debit of tezzies to a balance.

type balance_updates = (balance * balance_update) list

A list of balance updates. Duplicates may happen.

val balance_updates_encoding : balance_updates Tezos_base__TzPervasives.Data_encoding.t
val cleanup_balance_updates : balance_updates -> balance_updates

Remove zero-valued balances from a list of updates.

type frozen_balance = {
  1. deposit : Tez_repr.t;
  2. fees : Tez_repr.t;
  3. rewards : Tez_repr.t;
}
val init : Raw_context.t -> Contract_repr.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Allow to register a delegate when creating an account.

val remove : Raw_context.t -> Contract_repr.t -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Cleanup delegation when deleting a contract.

val get : Raw_context.t -> Contract_repr.t -> (Tezos_base__TzPervasives.Signature.public_key_hash option, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Reading the current delegate of a contract.

val registered : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (bool, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val set : Raw_context.t -> Contract_repr.t -> Tezos_base__TzPervasives.Signature.public_key_hash option -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Updating the delegate of a contract.

When calling this function on an "implicit contract" and setting the delegate to the contract manager registers it as a delegate. One cannot unregister a delegate for now. The associate contract is now 'undeletable'.

type Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error +=
  1. | No_deletion of Tezos_base__TzPervasives.Signature.public_key_hash
  2. | Active_delegate
  3. | Current_delegate
  4. | Empty_delegate_account of Tezos_base__TzPervasives.Signature.public_key_hash
  5. | Balance_too_low_for_deposit of {
    1. delegate : Tezos_base__TzPervasives.Signature.public_key_hash;
    2. deposit : Tez_repr.t;
    3. balance : Tez_repr.t;
    }
val fold : Raw_context.t -> init:'a -> f:(Tezos_base__TzPervasives.Signature.public_key_hash -> 'a -> 'a Lwt.t) -> 'a Lwt.t

Iterate on all registered delegates.

val list : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash list Lwt.t

List all registered delegates.

val freeze_deposit : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Tez_repr.t -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Various functions to 'freeze' tokens. A frozen 'deposit' keeps its associated rolls. When frozen, 'fees' may trigger new rolls allocation. Rewards won't trigger new rolls allocation until unfrozen.

val freeze_fees : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Tez_repr.t -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val freeze_rewards : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Tez_repr.t -> (Raw_context.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val cycle_end : Raw_context.t -> Cycle_repr.t -> Nonce_storage.unrevealed list -> (Raw_context.t * balance_updates * Tezos_base__TzPervasives.Signature.public_key_hash list, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Trigger the context maintenance at the end of cycle 'n', i.e.: unfreeze deposit/fees/rewards from 'n - preserved_cycle' ; punish the provided unrevealed seeds (tipically seed from cycle 'n - 1'). Returns a list of account with the amount that was unfrozen for each and the list of deactivated delegates.

val punish : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Cycle_repr.t -> (Raw_context.t * frozen_balance, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Burn all then frozen deposit/fees/rewards for a delegate at a given cycle. Returns the burned amounts.

val has_frozen_balance : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Cycle_repr.t -> (bool, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Has the given key some frozen tokens in its implicit contract?

val frozen_balance : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Returns the amount of frozen deposit, fees and rewards associated to a given delegate.

val frozen_balance_encoding : frozen_balance Tezos_base__TzPervasives.Data_encoding.t
val frozen_balance_by_cycle_encoding : frozen_balance Cycle_repr.Map.t Tezos_base__TzPervasives.Data_encoding.t
val frozen_balance_by_cycle : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> frozen_balance Cycle_repr.Map.t Lwt.t

Returns the amount of frozen deposit, fees and rewards associated to a given delegate, indexed by the cycle by which at the end the balance will be unfrozen.

val full_balance : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t

Returns the full 'balance' of the implicit contract associated to a given key, i.e. the sum of the spendable balance and of the frozen balance.

val staking_balance : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val delegated_contracts : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> Contract_repr.t list Lwt.t

Returns the list of contracts (implicit or originated) that delegated towards a given delegate

val delegated_balance : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Tez_repr.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val deactivated : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (bool, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
val grace_period : Raw_context.t -> Tezos_base__TzPervasives.Signature.public_key_hash -> (Cycle_repr.t, Tezos_protocol_environment_005_PsBabyM1__Environment.Error_monad.error list) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.