Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type DatumType = State
- type RedeemerType = Input
- headValidator :: State -> Input -> ScriptContext -> Bool
- checkAbort :: ScriptContext -> CurrencySymbol -> [Party] -> Bool
- checkCollectCom :: ScriptContext -> (ContestationPeriod, [Party], CurrencySymbol) -> Bool
- commitDatum :: TxOut -> [Commit]
- depositDatum :: TxOut -> [Commit]
- checkIncrement :: ScriptContext -> OpenDatum -> IncrementRedeemer -> Bool
- checkDecrement :: ScriptContext -> OpenDatum -> DecrementRedeemer -> Bool
- checkClose :: ScriptContext -> OpenDatum -> CloseRedeemer -> Bool
- checkContest :: ScriptContext -> ClosedDatum -> ContestRedeemer -> Bool
- checkFanout :: ScriptContext -> ClosedDatum -> Integer -> Integer -> Integer -> Bool
- makeContestationDeadline :: ContestationPeriod -> ScriptContext -> POSIXTime
- getHeadInput :: ScriptContext -> TxInInfo
- getHeadAddress :: ScriptContext -> Address
- mustNotChangeParameters :: ([Party], [Party]) -> (ContestationPeriod, ContestationPeriod) -> (CurrencySymbol, CurrencySymbol) -> Bool
- mustBeSignedByParticipant :: ScriptContext -> CurrencySymbol -> Bool
- findParticipationTokens :: CurrencySymbol -> Value -> [TokenName]
- headOutputDatum :: ScriptContext -> Datum
- getTxOutDatum :: TxOut -> Datum
- hasPT :: CurrencySymbol -> TxOut -> Bool
- verifySnapshotSignature :: [Party] -> (CurrencySymbol, SnapshotVersion, SnapshotNumber, Hash, Hash, Hash) -> [Signature] -> Bool
- verifyPartySignature :: (CurrencySymbol, SnapshotVersion, SnapshotNumber, Hash, Hash, Hash) -> Party -> Signature -> Bool
- compiledValidator :: CompiledCode ValidatorType
- validatorScript :: PlutusScript
- decodeHeadOutputClosedDatum :: ScriptContext -> ClosedDatum
- decodeHeadOutputOpenDatum :: ScriptContext -> OpenDatum
- emptyHash :: Hash
Documentation
type RedeemerType = Input Source #
checkAbort :: ScriptContext -> CurrencySymbol -> [Party] -> Bool Source #
On-Chain verification for Abort
transition. It verifies that:
- All PTs have been burnt: The right number of Head tokens with the correct head id are burnt, one PT for each party and a state token ST.
- All committed funds have been redistributed. This is done via v_commit and it only needs to ensure that we have spent all comitted outputs, which follows from burning all the PTs.
:: ScriptContext | Script execution context |
-> (ContestationPeriod, [Party], CurrencySymbol) | |
-> Bool |
On-Chain verification for CollectCom
transition. It verifies that:
- All participants have committed (even empty commits)
- All commits are properly collected and locked into η as a hash of serialized tx outputs in the same sequence as commit inputs!
- The transaction is performed (i.e. signed) by one of the head participants
- State token (ST) is present in the output
commitDatum :: TxOut -> [Commit] Source #
Try to find the commit datum in the input and if it is there return the committed utxo
depositDatum :: TxOut -> [Commit] Source #
Try to find the deposit datum in the input and if it is there return the committed utxo
:: ScriptContext | |
-> OpenDatum | Open state before the increment |
-> IncrementRedeemer | |
-> Bool |
Verify a increment transaction.
:: ScriptContext | |
-> OpenDatum | Open state before the decrement |
-> DecrementRedeemer | |
-> Bool |
Verify a decrement transaction.
:: ScriptContext | |
-> OpenDatum | Open state before the close |
-> CloseRedeemer | Type of close transition. |
-> Bool |
Verify a close transaction.
:: ScriptContext | |
-> ClosedDatum | Closed state before the close |
-> ContestRedeemer | Type of contest transition. |
-> Bool |
Verify a contest transaction.
:: ScriptContext | |
-> ClosedDatum | Closed state before the fanout |
-> Integer | Number of normal outputs to fanout |
-> Integer | Number of alpha outputs to fanout |
-> Integer | Number of delta outputs to fanout |
-> Bool |
Verify a fanout transaction.
makeContestationDeadline :: ContestationPeriod -> ScriptContext -> POSIXTime Source #
getHeadInput :: ScriptContext -> TxInInfo Source #
This is safe only because usually Head transaction only consume one input.
getHeadAddress :: ScriptContext -> Address Source #
mustNotChangeParameters :: ([Party], [Party]) -> (ContestationPeriod, ContestationPeriod) -> (CurrencySymbol, CurrencySymbol) -> Bool Source #
mustBeSignedByParticipant :: ScriptContext -> CurrencySymbol -> Bool Source #
findParticipationTokens :: CurrencySymbol -> Value -> [TokenName] Source #
headOutputDatum :: ScriptContext -> Datum Source #
getTxOutDatum :: TxOut -> Datum Source #
verifySnapshotSignature :: [Party] -> (CurrencySymbol, SnapshotVersion, SnapshotNumber, Hash, Hash, Hash) -> [Signature] -> Bool Source #
Verify the multi-signature of a snapshot using given constituents State
,
ClosedDatum
, number
, ClosedDatum
and utxoToDecommitHash
. See
'SignableRepresentation Snapshot' for more details.
verifyPartySignature :: (CurrencySymbol, SnapshotVersion, SnapshotNumber, Hash, Hash, Hash) -> Party -> Signature -> Bool Source #
Verify individual party signature of a snapshot. See 'SignableRepresentation Snapshot' for more details.
compiledValidator :: CompiledCode ValidatorType Source #
validatorScript :: PlutusScript Source #
decodeHeadOutputClosedDatum :: ScriptContext -> ClosedDatum Source #
decodeHeadOutputOpenDatum :: ScriptContext -> OpenDatum Source #