morley-1.16.1: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Morley.Michelson.Typed.Operation

Synopsis

Documentation

newtype OperationHash Source #

Constructors

OperationHash 

Instances

Instances details
Eq OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

Ord OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

Show OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

Generic OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

Associated Types

type Rep OperationHash :: Type -> Type #

NFData OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

Methods

rnf :: OperationHash -> () #

type Rep OperationHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Operation

type Rep OperationHash = D1 ('MetaData "OperationHash" "Morley.Michelson.Typed.Operation" "morley-1.16.1-inplace" 'True) (C1 ('MetaCons "OperationHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unOperationHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

data OriginationOperation Source #

Data necessary to originate a contract.

Constructors

forall cp st.(StorageScope st, ParameterScope cp) => OriginationOperation 

Fields

data TransferOperation Source #

Data necessary to send a transaction to given address which is assumed to be the address of an originated contract.

data SetDelegateOperation Source #

Set contract's delegate

Constructors

SetDelegateOperation 

Fields

mkContractAddress :: OperationHash -> GlobalCounter -> Address Source #

Compute address of a contract from its origination operation and global counter.

However, in real Tezos encoding of the operation is more than just OriginationOperation. There an Operation has several more meta-fields plus a big sum-type of all possible operations.

See here: https://gitlab.com/tezos/tezos/-/blob/f57c50e3a657956d69a1699978de9873c98f0018/src/proto_006_PsCARTHA/lib_protocol/operation_repr.ml#L78

In other words, contract hash is calculated as the blake2b160 (20-byte) hash of origination operation hash + word64 global counter.

In Morley we do not yet support full encoding of Tezos Operations, therefore we choose to generate contract addresses in a simplified manner.

Namely, we encode OriginationOperation as we can and concat it with the global counter.