plutus-script-utils-1.2.0.0: Helper/utility functions for writing Plutus scripts.
Safe HaskellNone
LanguageHaskell2010

Plutus.Script.Utils.V1.Scripts

Description

This module contains functions related to the computation of script hashes for PlutusV1.

Synopsis

Script hashes

data Validator #

Instances

Instances details
Eq Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep Validator :: Type -> Type Source #

NFData Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: Validator -> () Source #

Serialise Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

encode :: Validator -> Encoding

decode :: Decoder s Validator

encodeList :: [Validator] -> Encoding

decodeList :: Decoder s [Validator]

Pretty Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: Validator -> Doc ann

prettyList :: [Validator] -> Doc ann

type Rep Validator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep Validator = D1 ('MetaData "Validator" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "Validator" 'PrefixI 'True) (S1 ('MetaSel ('Just "getValidator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Script)))

data ValidatorHash #

Instances

Instances details
Eq ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

IsString ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep ValidatorHash :: Type -> Type Source #

NFData ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: ValidatorHash -> () Source #

Eq ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

FromData ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

fromBuiltinData :: BuiltinData -> Maybe ValidatorHash

Ord ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Pretty ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: ValidatorHash -> Doc ann

prettyList :: [ValidatorHash] -> Doc ann

ToData ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

toBuiltinData :: ValidatorHash -> BuiltinData

UnsafeFromData ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

unsafeFromBuiltinData :: BuiltinData -> ValidatorHash

Lift DefaultUni ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

lift :: ValidatorHash -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

typeRep :: Proxy ValidatorHash -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep ValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep ValidatorHash = D1 ('MetaData "ValidatorHash" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "ValidatorHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

data MintingPolicy #

Instances

Instances details
Eq MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep MintingPolicy :: Type -> Type Source #

NFData MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: MintingPolicy -> () Source #

Serialise MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

encode :: MintingPolicy -> Encoding

decode :: Decoder s MintingPolicy

encodeList :: [MintingPolicy] -> Encoding

decodeList :: Decoder s [MintingPolicy]

Pretty MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: MintingPolicy -> Doc ann

prettyList :: [MintingPolicy] -> Doc ann

type Rep MintingPolicy 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep MintingPolicy = D1 ('MetaData "MintingPolicy" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "MintingPolicy" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMintingPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Script)))

data MintingPolicyHash #

Instances

Instances details
Eq MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

IsString MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep MintingPolicyHash :: Type -> Type Source #

NFData MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: MintingPolicyHash -> () Source #

Eq MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

FromData MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

fromBuiltinData :: BuiltinData -> Maybe MintingPolicyHash

Ord MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Pretty MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: MintingPolicyHash -> Doc ann

prettyList :: [MintingPolicyHash] -> Doc ann

ToData MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

toBuiltinData :: MintingPolicyHash -> BuiltinData

UnsafeFromData MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

unsafeFromBuiltinData :: BuiltinData -> MintingPolicyHash

Lift DefaultUni MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

lift :: MintingPolicyHash -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

typeRep :: Proxy MintingPolicyHash -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep MintingPolicyHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep MintingPolicyHash = D1 ('MetaData "MintingPolicyHash" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "MintingPolicyHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

data StakeValidator #

Instances

Instances details
Eq StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep StakeValidator :: Type -> Type Source #

NFData StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: StakeValidator -> () Source #

Serialise StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

encode :: StakeValidator -> Encoding

decode :: Decoder s StakeValidator

encodeList :: [StakeValidator] -> Encoding

decodeList :: Decoder s [StakeValidator]

Pretty StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: StakeValidator -> Doc ann

prettyList :: [StakeValidator] -> Doc ann

type Rep StakeValidator 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep StakeValidator = D1 ('MetaData "StakeValidator" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "StakeValidator" 'PrefixI 'True) (S1 ('MetaSel ('Just "getStakeValidator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Script)))

data StakeValidatorHash #

Instances

Instances details
Eq StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Ord StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Show StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

IsString StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Generic StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Associated Types

type Rep StakeValidatorHash :: Type -> Type Source #

NFData StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

rnf :: StakeValidatorHash -> () Source #

Eq StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

FromData StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

fromBuiltinData :: BuiltinData -> Maybe StakeValidatorHash

Ord StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Pretty StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: StakeValidatorHash -> Doc ann

prettyList :: [StakeValidatorHash] -> Doc ann

ToData StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

toBuiltinData :: StakeValidatorHash -> BuiltinData

UnsafeFromData StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

unsafeFromBuiltinData :: BuiltinData -> StakeValidatorHash

Lift DefaultUni StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

lift :: StakeValidatorHash -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

typeRep :: Proxy StakeValidatorHash -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep StakeValidatorHash 
Instance details

Defined in Plutus.V1.Ledger.Scripts

type Rep StakeValidatorHash = D1 ('MetaData "StakeValidatorHash" "Plutus.V1.Ledger.Scripts" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'True) (C1 ('MetaCons "StakeValidatorHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

fromCardanoHash :: ScriptHash -> ScriptHash Source #

Transform a Cardano Script hash in a Plutus Script hash

scriptHash :: Script -> ScriptHash Source #

Hash a Script

Script utilities

scriptCurrencySymbol :: MintingPolicy -> CurrencySymbol Source #

The CurrencySymbol of a MintingPolicy.

toCardanoApiScript :: Script -> Script PlutusScriptV1 Source #

Convert a Script to a 'cardano-api' script.

For why we depend on `cardano-api`, see note [Hash computation of datums, redeemers and scripts]