Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Minting policy for a single head tokens.
Synopsis
- validate :: ScriptHash -> ScriptHash -> TxOutRef -> MintAction -> ScriptContext -> Bool
- validateTokensMinting :: ScriptHash -> ScriptHash -> TxOutRef -> ScriptContext -> Bool
- validateTokensBurning :: ScriptContext -> Bool
- unappliedMintingPolicy :: CompiledCode (TxOutRef -> MintingPolicyType)
- mintingPolicyScript :: TxOutRef -> SerialisedScript
- headPolicyId :: TxIn -> PolicyId
- mkHeadTokenScript :: TxIn -> PlutusScript
Documentation
validate :: ScriptHash -> ScriptHash -> TxOutRef -> MintAction -> ScriptContext -> Bool Source #
validateTokensMinting :: ScriptHash -> ScriptHash -> TxOutRef -> ScriptContext -> Bool Source #
When minting head tokens we want to make sure that:
- The number of minted PTs == number of participants (+1 for the ST) evident from the datum.
- There is single state token that is paid into v_head, which ensures continuity.
- PTs are distributed to v_initial
- Each v_initial has the policy id as its datum
- Ensure out-ref and the headId are in the datum of the first output of the transaction which mints tokens.
validateTokensBurning :: ScriptContext -> Bool Source #
Token burning check should: * Not restrict burning on the mu_head at all.
It is ensured by the v_head validator, when tokens of a specific headId may be burned.
validateTokensBurning
just makes sure all tokens have negative quantity.
unappliedMintingPolicy :: CompiledCode (TxOutRef -> MintingPolicyType) Source #
Raw minting policy code where the TxOutRef
is still a parameter.
mintingPolicyScript :: TxOutRef -> SerialisedScript Source #
Get the applied head minting policy script given a seed TxOutRef
.
Create PolicyId
headPolicyId :: TxIn -> PolicyId Source #
Get the head policy id (a.k.a headId) given a seed TxIn
.
mkHeadTokenScript :: TxIn -> PlutusScript Source #
Get the applied head minting policy script given a seed TxIn
.