plutus-contract-1.1.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.StateMachine.ThreadToken

Description

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

Documentation

data ThreadToken Source #

Instances

Instances details
Eq ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Ord ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Show ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Generic ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Associated Types

type Rep ThreadToken :: Type -> Type Source #

ToJSON ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

FromJSON ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

ToSchema ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

UnsafeFromData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

FromData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

ToData ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Lift DefaultUni ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Typeable DefaultUni ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

type Rep ThreadToken Source # 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

type Rep ThreadToken = D1 ('MetaData "ThreadToken" "Plutus.Contract.StateMachine.ThreadToken" "plutus-contract-1.1.0.0-KZTRXOViW1GCXNPMdYqx30" 'False) (C1 ('MetaCons "ThreadToken" 'PrefixI 'True) (S1 ('MetaSel ('Just "ttOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "ttCurrencySymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CurrencySymbol)))

threadTokenValue :: CurrencySymbol -> ValidatorHash -> Value Source #

The Value containing exactly the thread token.

checkThreadTokenInner Source #

Arguments

:: 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 TokenName of the thread token.

-> Value

The value to check.

-> Integer

The expected number of thread tokens in the given value, n.

-> Bool

True if and only if exactly n thread tokens (and no other tokens) with the given CurrencySymbol are in the given Value.

Check exactly n thread tokens and no other tokens with the given CurrencySymbol are in the given Value.