hydra-plutus
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Contract.Util

Synopsis

Documentation

hydraHeadV2 :: BuiltinByteString Source #

hasST :: CurrencySymbol -> Value -> Bool Source #

Checks that the output contains the state token (ST) with the head CurrencySymbol and TokenName of hydraHeadV2

mustBurnAllHeadTokens :: MintValue -> CurrencySymbol -> [Party] -> Bool Source #

Checks all tokens related to some specific CurrencySymbol.

This checks both PTs and ST are burnt.

mustPreserveHeadValue :: ScriptContext -> Bool Source #

Check whether own input and first output preserve value exactly.

hashPreSerializedCommits :: [Commit] -> BuiltinByteString Source #

Hash a potentially unordered list of commits by sorting them, concatenating their preSerializedOutput bytes and creating a SHA2_256 digest over that.

NOTE: See note from hashTxOuts.

hashTxOuts :: [TxOut] -> BuiltinByteString Source #

Hash a pre-ordered list of transaction outputs by serializing each individual TxOut, concatenating all bytes together and creating a SHA2_256 digest over that.

NOTE: In general, from asserting that `hash(x || y) = hash (x' || y')` it is not safe to conclude that `(x,y) = (x', y')` as the same hash could be obtained by moving one or more bytes from the end of x to the beginning of y, but in the context of Hydra validators it seems impossible to exploit this property without breaking other logic or verification (eg. producing a valid and meaningful TxOut).

compareRef :: TxOutRef -> TxOutRef -> Ordering Source #

scriptOutputsAt :: ScriptHash -> TxInfo -> [(OutputDatum, Value)] Source #

Get the list of TxOut outputs of the pending transaction at a given script address.