hydra-plutus-0.19.0: Hydra Plutus Contracts
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Contract.Initial

Description

The initial validator which allows participants to commit or abort.

Synopsis

Documentation

data InitialRedeemer Source #

Constructors

ViaAbort 
ViaCommit 

Fields

Instances

Instances details
FromData InitialRedeemer Source # 
Instance details

Defined in Hydra.Contract.Initial

Methods

fromBuiltinData :: BuiltinData -> Maybe InitialRedeemer

ToData InitialRedeemer Source # 
Instance details

Defined in Hydra.Contract.Initial

Methods

toBuiltinData :: InitialRedeemer -> BuiltinData

UnsafeFromData InitialRedeemer Source # 
Instance details

Defined in Hydra.Contract.Initial

Methods

unsafeFromBuiltinData :: BuiltinData -> InitialRedeemer

type DatumType = CurrencySymbol Source #

validator Source #

Arguments

:: ScriptHash

Hash of the commit validator

-> DatumType 
-> RedeemerType 
-> ScriptContext 
-> Bool 

The v_initial validator verifies that:

  • spent in a transaction also consuming a v_head output
  • ensures the committed value is recorded correctly in the output datum
  • ensures that the transaction was signed by the key corresponding to the PubKeyHash encoded in the participation token name

NOTE: It does not need to ensure that the participation token is of some specific Head currency.

checkCommit Source #

Arguments

:: ScriptHash

Hash of the commit validator

-> CurrencySymbol

Head id

-> [TxOutRef] 
-> ScriptContext 
-> Bool 

compiledValidator :: CompiledCode ValidatorType Source #

validatorScript :: SerialisedScript Source #

validatorHash :: ScriptHash Source #

datum :: DatumType -> Datum Source #

redeemer :: RedeemerType -> Redeemer Source #