Safe Haskell | None |
---|---|
Language | Haskell2010 |
Thread token data type definition and minting policy. Thread tokens are used to identify the contract instance on the blockchain, and ensuring that the state was produced by running the state machine from its initial state.
Synopsis
- data ThreadToken = ThreadToken {
- ttOutRef :: TxOutRef
- ttCurrencySymbol :: CurrencySymbol
- checkPolicy :: TxOutRef -> (ValidatorHash, MintingPolarity) -> ScriptContext -> Bool
- curPolicy :: TxOutRef -> MintingPolicy
- threadTokenValue :: CurrencySymbol -> ValidatorHash -> Value
- checkThreadTokenInner :: CurrencySymbol -> ValidatorHash -> Value -> Integer -> Bool
- checkThreadToken :: Maybe ThreadToken -> ValidatorHash -> Value -> Integer -> Bool
Documentation
data ThreadToken Source #
ThreadToken | |
|
Instances
checkPolicy :: TxOutRef -> (ValidatorHash, MintingPolarity) -> ScriptContext -> Bool Source #
threadTokenValue :: CurrencySymbol -> ValidatorHash -> Value Source #
The Value
containing exactly the thread token.
checkThreadTokenInner Source #
:: CurrencySymbol | The currency symbol of the thread token. |
-> ValidatorHash | The hash of the (state machine) validator script using this thread
token. This is used as the |
-> Value | The value to check. |
-> Integer | The expected number of thread tokens in the given value, |
-> Bool | True if and only if exactly |
Check exactly n
thread tokens and no other tokens with the given
CurrencySymbol
are in the given Value
.
checkThreadToken :: Maybe ThreadToken -> ValidatorHash -> Value -> Integer -> Bool Source #