2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2017-11-14 03:36:14 +04:00
|
|
|
(* Copyright (c) 2014 - 2017. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
open Tezos_hash
|
|
|
|
|
|
|
|
type t = private
|
2016-11-14 18:54:21 +04:00
|
|
|
| Default of Ed25519.Public_key_hash.t
|
2017-02-16 22:01:35 +04:00
|
|
|
| Originated of Contract_hash.t
|
2016-09-08 21:13:10 +04:00
|
|
|
type contract = t
|
|
|
|
|
|
|
|
include Compare.S with type t := contract
|
|
|
|
|
2017-03-09 22:17:13 +04:00
|
|
|
(** {2 Default contracts} *****************************************************)
|
|
|
|
|
2016-11-14 18:54:21 +04:00
|
|
|
val default_contract : Ed25519.Public_key_hash.t -> contract
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2016-11-14 18:54:21 +04:00
|
|
|
val is_default : contract -> Ed25519.Public_key_hash.t option
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-03-09 22:17:13 +04:00
|
|
|
(** {2 Originated contracts} **************************************************)
|
|
|
|
|
|
|
|
(** Originated contracts handles are crafted from the hash of the
|
|
|
|
operation that triggered their origination (and nothing else).
|
|
|
|
As a single operation can trigger several originations, the
|
|
|
|
corresponding handles are forged from a deterministic sequence of
|
|
|
|
nonces, initialized with the hash of the operation. *)
|
2017-02-16 22:01:35 +04:00
|
|
|
type origination_nonce
|
|
|
|
|
|
|
|
val originated_contract : origination_nonce -> contract
|
2017-03-09 22:17:13 +04:00
|
|
|
|
2017-02-16 22:01:35 +04:00
|
|
|
val originated_contracts : origination_nonce -> contract list
|
|
|
|
|
|
|
|
val initial_origination_nonce : Operation_hash.t -> origination_nonce
|
2017-03-09 22:17:13 +04:00
|
|
|
|
2017-02-16 22:01:35 +04:00
|
|
|
val incr_origination_nonce : origination_nonce -> origination_nonce
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** {2 Human readable notation} ***********************************************)
|
|
|
|
|
2017-03-09 22:17:13 +04:00
|
|
|
type error += Invalid_contract_notation of string (* `Permanent *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-19 21:22:32 +04:00
|
|
|
val to_b58check: contract -> string
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-02-19 21:22:32 +04:00
|
|
|
val of_b58check: string -> contract tzresult
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-03-09 22:17:13 +04:00
|
|
|
val pp: Format.formatter -> contract -> unit
|
|
|
|
|
|
|
|
val pp_short: Format.formatter -> contract -> unit
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
(** {2 Serializers} ***********************************************************)
|
|
|
|
|
|
|
|
val encoding : contract Data_encoding.t
|
2017-02-16 22:01:35 +04:00
|
|
|
|
|
|
|
val origination_nonce_encoding : origination_nonce Data_encoding.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val arg : contract RPC.Arg.arg
|