package tezos-protocol-alpha

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.1.tar.gz
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f

doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Delegate_storage/Contract/index.html

Module Delegate_storage.ContractSource

This module ensures the following invariants:

  • registered delegates (i.e. those that appear in Storage.Delegates) are self-delegated, that is a delegate's implicit account delegates to itself (i.e. Contract_delegate_storage.find delegate returns delegate),
  • registered delegates have their public keys revealed,
  • registered delegates cannot change their delegation,
  • stake is properly moved when changing delegation.

init ctxt contract delegate registers a delegate when creating a contract.

This functions assumes that contract is allocated.

This function returns the Unregistered_delegate error if contract already has a delegate or if delegate is not a registered delegate.

set ctxt contract delegate_opt allows to set the delegate of a contract to delegate when delegate_opt = Some delegate or to unset the delegate when delegate_opt = None. When delegate_opt = Some contract (aka self-delegation), the function also registers the contract as a delegate and sets the delegate as active.

It returns the Unregistered_delegate error when self-delegating and when the public key is not yet revealed. It returns the Empty_delegate_account error when self-delegating and the implicit account is not allocated. It returns the Active_delegate error when self-delegating and the delegate is already active. It returns the Unregistered_delegate error when trying to set the delegate to an unregistered delegate. It returns the Current_delegate error when contract is already delegated to the same delegate. It returns the No_deletion error when trying to unset or change the delegate of a registered delegate.

OCaml

Innovation. Community. Security.