Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The interface to Plutus V3 for the ledger.
Synopsis
- type SerialisedScript = ShortByteString
- data ScriptForEvaluation
- serialisedScript ∷ ScriptForEvaluation → SerialisedScript
- deserialisedScript ∷ ScriptForEvaluation → ScriptNamedDeBruijn
- serialiseCompiledCode ∷ ∀ a. CompiledCode a → SerialisedScript
- serialiseUPLC ∷ Program DeBruijn DefaultUni DefaultFun () → SerialisedScript
- deserialiseScript ∷ ∀ m. MonadError ScriptDecodeError m ⇒ MajorProtocolVersion → SerialisedScript → m ScriptForEvaluation
- uncheckedDeserialiseUPLC ∷ SerialisedScript → Program DeBruijn DefaultUni DefaultFun ()
- evaluateScriptRestricting ∷ MajorProtocolVersion → VerboseMode → EvaluationContext → ExBudget → ScriptForEvaluation → Data → (LogOutput, Either EvaluationError ExBudget)
- evaluateScriptCounting ∷ MajorProtocolVersion → VerboseMode → EvaluationContext → ScriptForEvaluation → Data → (LogOutput, Either EvaluationError ExBudget)
- newtype ColdCommitteeCredential = ColdCommitteeCredential Credential
- newtype HotCommitteeCredential = HotCommitteeCredential Credential
- newtype DRepCredential = DRepCredential Credential
- data DRep
- data Delegatee
- data TxCert
- = TxCertRegStaking Credential (Maybe Lovelace)
- | TxCertUnRegStaking Credential (Maybe Lovelace)
- | TxCertDelegStaking Credential Delegatee
- | TxCertRegDeleg Credential Delegatee Lovelace
- | TxCertRegDRep DRepCredential Lovelace
- | TxCertUpdateDRep DRepCredential
- | TxCertUnRegDRep DRepCredential Lovelace
- | TxCertPoolRegister PubKeyHash PubKeyHash
- | TxCertPoolRetire PubKeyHash Integer
- | TxCertAuthHotCommittee ColdCommitteeCredential HotCommitteeCredential
- | TxCertResignColdCommittee ColdCommitteeCredential
- data Voter
- data Vote
- data GovernanceActionId = GovernanceActionId {}
- data Committee = Committee {}
- newtype Constitution = Constitution {}
- data ProtocolVersion = ProtocolVersion {}
- data GovernanceAction
- = ParameterChange (Maybe GovernanceActionId) ChangedParameters (Maybe ScriptHash)
- | HardForkInitiation (Maybe GovernanceActionId) ProtocolVersion
- | TreasuryWithdrawals (Map Credential Lovelace) (Maybe ScriptHash)
- | NoConfidence (Maybe GovernanceActionId)
- | UpdateCommittee (Maybe GovernanceActionId) [ColdCommitteeCredential] (Map ColdCommitteeCredential Integer) Rational
- | NewConstitution (Maybe GovernanceActionId) Constitution
- | InfoAction
- newtype ChangedParameters = ChangedParameters {}
- data ProposalProcedure = ProposalProcedure {}
- newtype MajorProtocolVersion = MajorProtocolVersion {}
- data VerboseMode
- type LogOutput = [Text]
- data ExBudget = ExBudget {}
- newtype ExCPU = ExCPU CostingInteger
- newtype ExMemory = ExMemory CostingInteger
- data SatInt
- fromSatInt ∷ Num a ⇒ SatInt → a
- data EvaluationContext
- mkEvaluationContext ∷ (MonadError CostModelApplyError m, MonadWriter [CostModelApplyWarn] m) ⇒ [Int64] → m EvaluationContext
- data ParamName
- = AddInteger'cpu'arguments'intercept
- | AddInteger'cpu'arguments'slope
- | AddInteger'memory'arguments'intercept
- | AddInteger'memory'arguments'slope
- | AppendByteString'cpu'arguments'intercept
- | AppendByteString'cpu'arguments'slope
- | AppendByteString'memory'arguments'intercept
- | AppendByteString'memory'arguments'slope
- | AppendString'cpu'arguments'intercept
- | AppendString'cpu'arguments'slope
- | AppendString'memory'arguments'intercept
- | AppendString'memory'arguments'slope
- | BData'cpu'arguments
- | BData'memory'arguments
- | Blake2b_256'cpu'arguments'intercept
- | Blake2b_256'cpu'arguments'slope
- | Blake2b_256'memory'arguments
- | CekApplyCost'exBudgetCPU
- | CekApplyCost'exBudgetMemory
- | CekBuiltinCost'exBudgetCPU
- | CekBuiltinCost'exBudgetMemory
- | CekConstCost'exBudgetCPU
- | CekConstCost'exBudgetMemory
- | CekDelayCost'exBudgetCPU
- | CekDelayCost'exBudgetMemory
- | CekForceCost'exBudgetCPU
- | CekForceCost'exBudgetMemory
- | CekLamCost'exBudgetCPU
- | CekLamCost'exBudgetMemory
- | CekStartupCost'exBudgetCPU
- | CekStartupCost'exBudgetMemory
- | CekVarCost'exBudgetCPU
- | CekVarCost'exBudgetMemory
- | ChooseData'cpu'arguments
- | ChooseData'memory'arguments
- | ChooseList'cpu'arguments
- | ChooseList'memory'arguments
- | ChooseUnit'cpu'arguments
- | ChooseUnit'memory'arguments
- | ConsByteString'cpu'arguments'intercept
- | ConsByteString'cpu'arguments'slope
- | ConsByteString'memory'arguments'intercept
- | ConsByteString'memory'arguments'slope
- | ConstrData'cpu'arguments
- | ConstrData'memory'arguments
- | DecodeUtf8'cpu'arguments'intercept
- | DecodeUtf8'cpu'arguments'slope
- | DecodeUtf8'memory'arguments'intercept
- | DecodeUtf8'memory'arguments'slope
- | DivideInteger'cpu'arguments'constant
- | DivideInteger'cpu'arguments'model'arguments'c00
- | DivideInteger'cpu'arguments'model'arguments'c01
- | DivideInteger'cpu'arguments'model'arguments'c02
- | DivideInteger'cpu'arguments'model'arguments'c10
- | DivideInteger'cpu'arguments'model'arguments'c11
- | DivideInteger'cpu'arguments'model'arguments'c20
- | DivideInteger'cpu'arguments'model'arguments'minimum
- | DivideInteger'memory'arguments'intercept
- | DivideInteger'memory'arguments'minimum
- | DivideInteger'memory'arguments'slope
- | EncodeUtf8'cpu'arguments'intercept
- | EncodeUtf8'cpu'arguments'slope
- | EncodeUtf8'memory'arguments'intercept
- | EncodeUtf8'memory'arguments'slope
- | EqualsByteString'cpu'arguments'constant
- | EqualsByteString'cpu'arguments'intercept
- | EqualsByteString'cpu'arguments'slope
- | EqualsByteString'memory'arguments
- | EqualsData'cpu'arguments'intercept
- | EqualsData'cpu'arguments'slope
- | EqualsData'memory'arguments
- | EqualsInteger'cpu'arguments'intercept
- | EqualsInteger'cpu'arguments'slope
- | EqualsInteger'memory'arguments
- | EqualsString'cpu'arguments'constant
- | EqualsString'cpu'arguments'intercept
- | EqualsString'cpu'arguments'slope
- | EqualsString'memory'arguments
- | FstPair'cpu'arguments
- | FstPair'memory'arguments
- | HeadList'cpu'arguments
- | HeadList'memory'arguments
- | IData'cpu'arguments
- | IData'memory'arguments
- | IfThenElse'cpu'arguments
- | IfThenElse'memory'arguments
- | IndexByteString'cpu'arguments
- | IndexByteString'memory'arguments
- | LengthOfByteString'cpu'arguments
- | LengthOfByteString'memory'arguments
- | LessThanByteString'cpu'arguments'intercept
- | LessThanByteString'cpu'arguments'slope
- | LessThanByteString'memory'arguments
- | LessThanEqualsByteString'cpu'arguments'intercept
- | LessThanEqualsByteString'cpu'arguments'slope
- | LessThanEqualsByteString'memory'arguments
- | LessThanEqualsInteger'cpu'arguments'intercept
- | LessThanEqualsInteger'cpu'arguments'slope
- | LessThanEqualsInteger'memory'arguments
- | LessThanInteger'cpu'arguments'intercept
- | LessThanInteger'cpu'arguments'slope
- | LessThanInteger'memory'arguments
- | ListData'cpu'arguments
- | ListData'memory'arguments
- | MapData'cpu'arguments
- | MapData'memory'arguments
- | MkCons'cpu'arguments
- | MkCons'memory'arguments
- | MkNilData'cpu'arguments
- | MkNilData'memory'arguments
- | MkNilPairData'cpu'arguments
- | MkNilPairData'memory'arguments
- | MkPairData'cpu'arguments
- | MkPairData'memory'arguments
- | ModInteger'cpu'arguments'constant
- | ModInteger'cpu'arguments'model'arguments'c00
- | ModInteger'cpu'arguments'model'arguments'c01
- | ModInteger'cpu'arguments'model'arguments'c02
- | ModInteger'cpu'arguments'model'arguments'c10
- | ModInteger'cpu'arguments'model'arguments'c11
- | ModInteger'cpu'arguments'model'arguments'c20
- | ModInteger'cpu'arguments'model'arguments'minimum
- | ModInteger'memory'arguments'intercept
- | ModInteger'memory'arguments'slope
- | MultiplyInteger'cpu'arguments'intercept
- | MultiplyInteger'cpu'arguments'slope
- | MultiplyInteger'memory'arguments'intercept
- | MultiplyInteger'memory'arguments'slope
- | NullList'cpu'arguments
- | NullList'memory'arguments
- | QuotientInteger'cpu'arguments'constant
- | QuotientInteger'cpu'arguments'model'arguments'c00
- | QuotientInteger'cpu'arguments'model'arguments'c01
- | QuotientInteger'cpu'arguments'model'arguments'c02
- | QuotientInteger'cpu'arguments'model'arguments'c10
- | QuotientInteger'cpu'arguments'model'arguments'c11
- | QuotientInteger'cpu'arguments'model'arguments'c20
- | QuotientInteger'cpu'arguments'model'arguments'minimum
- | QuotientInteger'memory'arguments'intercept
- | QuotientInteger'memory'arguments'minimum
- | QuotientInteger'memory'arguments'slope
- | RemainderInteger'cpu'arguments'constant
- | RemainderInteger'cpu'arguments'model'arguments'c00
- | RemainderInteger'cpu'arguments'model'arguments'c01
- | RemainderInteger'cpu'arguments'model'arguments'c02
- | RemainderInteger'cpu'arguments'model'arguments'c10
- | RemainderInteger'cpu'arguments'model'arguments'c11
- | RemainderInteger'cpu'arguments'model'arguments'c20
- | RemainderInteger'cpu'arguments'model'arguments'minimum
- | RemainderInteger'memory'arguments'intercept
- | RemainderInteger'memory'arguments'slope
- | SerialiseData'cpu'arguments'intercept
- | SerialiseData'cpu'arguments'slope
- | SerialiseData'memory'arguments'intercept
- | SerialiseData'memory'arguments'slope
- | Sha2_256'cpu'arguments'intercept
- | Sha2_256'cpu'arguments'slope
- | Sha2_256'memory'arguments
- | Sha3_256'cpu'arguments'intercept
- | Sha3_256'cpu'arguments'slope
- | Sha3_256'memory'arguments
- | SliceByteString'cpu'arguments'intercept
- | SliceByteString'cpu'arguments'slope
- | SliceByteString'memory'arguments'intercept
- | SliceByteString'memory'arguments'slope
- | SndPair'cpu'arguments
- | SndPair'memory'arguments
- | SubtractInteger'cpu'arguments'intercept
- | SubtractInteger'cpu'arguments'slope
- | SubtractInteger'memory'arguments'intercept
- | SubtractInteger'memory'arguments'slope
- | TailList'cpu'arguments
- | TailList'memory'arguments
- | Trace'cpu'arguments
- | Trace'memory'arguments
- | UnBData'cpu'arguments
- | UnBData'memory'arguments
- | UnConstrData'cpu'arguments
- | UnConstrData'memory'arguments
- | UnIData'cpu'arguments
- | UnIData'memory'arguments
- | UnListData'cpu'arguments
- | UnListData'memory'arguments
- | UnMapData'cpu'arguments
- | UnMapData'memory'arguments
- | VerifyEcdsaSecp256k1Signature'cpu'arguments
- | VerifyEcdsaSecp256k1Signature'memory'arguments
- | VerifyEd25519Signature'cpu'arguments'intercept
- | VerifyEd25519Signature'cpu'arguments'slope
- | VerifyEd25519Signature'memory'arguments
- | VerifySchnorrSecp256k1Signature'cpu'arguments'intercept
- | VerifySchnorrSecp256k1Signature'cpu'arguments'slope
- | VerifySchnorrSecp256k1Signature'memory'arguments
- | CekConstrCost'exBudgetCPU
- | CekConstrCost'exBudgetMemory
- | CekCaseCost'exBudgetCPU
- | CekCaseCost'exBudgetMemory
- | Bls12_381_G1_add'cpu'arguments
- | Bls12_381_G1_add'memory'arguments
- | Bls12_381_G1_compress'cpu'arguments
- | Bls12_381_G1_compress'memory'arguments
- | Bls12_381_G1_equal'cpu'arguments
- | Bls12_381_G1_equal'memory'arguments
- | Bls12_381_G1_hashToGroup'cpu'arguments'intercept
- | Bls12_381_G1_hashToGroup'cpu'arguments'slope
- | Bls12_381_G1_hashToGroup'memory'arguments
- | Bls12_381_G1_neg'cpu'arguments
- | Bls12_381_G1_neg'memory'arguments
- | Bls12_381_G1_scalarMul'cpu'arguments'intercept
- | Bls12_381_G1_scalarMul'cpu'arguments'slope
- | Bls12_381_G1_scalarMul'memory'arguments
- | Bls12_381_G1_uncompress'cpu'arguments
- | Bls12_381_G1_uncompress'memory'arguments
- | Bls12_381_G2_add'cpu'arguments
- | Bls12_381_G2_add'memory'arguments
- | Bls12_381_G2_compress'cpu'arguments
- | Bls12_381_G2_compress'memory'arguments
- | Bls12_381_G2_equal'cpu'arguments
- | Bls12_381_G2_equal'memory'arguments
- | Bls12_381_G2_hashToGroup'cpu'arguments'intercept
- | Bls12_381_G2_hashToGroup'cpu'arguments'slope
- | Bls12_381_G2_hashToGroup'memory'arguments
- | Bls12_381_G2_neg'cpu'arguments
- | Bls12_381_G2_neg'memory'arguments
- | Bls12_381_G2_scalarMul'cpu'arguments'intercept
- | Bls12_381_G2_scalarMul'cpu'arguments'slope
- | Bls12_381_G2_scalarMul'memory'arguments
- | Bls12_381_G2_uncompress'cpu'arguments
- | Bls12_381_G2_uncompress'memory'arguments
- | Bls12_381_finalVerify'cpu'arguments
- | Bls12_381_finalVerify'memory'arguments
- | Bls12_381_millerLoop'cpu'arguments
- | Bls12_381_millerLoop'memory'arguments
- | Bls12_381_mulMlResult'cpu'arguments
- | Bls12_381_mulMlResult'memory'arguments
- | Keccak_256'cpu'arguments'intercept
- | Keccak_256'cpu'arguments'slope
- | Keccak_256'memory'arguments
- | Blake2b_224'cpu'arguments'intercept
- | Blake2b_224'cpu'arguments'slope
- | Blake2b_224'memory'arguments
- | IntegerToByteString'cpu'arguments'c0
- | IntegerToByteString'cpu'arguments'c1
- | IntegerToByteString'cpu'arguments'c2
- | IntegerToByteString'memory'arguments'intercept
- | IntegerToByteString'memory'arguments'slope
- | ByteStringToInteger'cpu'arguments'c0
- | ByteStringToInteger'cpu'arguments'c1
- | ByteStringToInteger'cpu'arguments'c2
- | ByteStringToInteger'memory'arguments'intercept
- | ByteStringToInteger'memory'arguments'slope
- | AndByteString'cpu'arguments'intercept
- | AndByteString'cpu'arguments'slope1
- | AndByteString'cpu'arguments'slope2
- | AndByteString'memory'arguments'intercept
- | AndByteString'memory'arguments'slope
- | OrByteString'cpu'arguments'intercept
- | OrByteString'cpu'arguments'slope1
- | OrByteString'cpu'arguments'slope2
- | OrByteString'memory'arguments'intercept
- | OrByteString'memory'arguments'slope
- | XorByteString'cpu'arguments'intercept
- | XorByteString'cpu'arguments'slope1
- | XorByteString'cpu'arguments'slope2
- | XorByteString'memory'arguments'intercept
- | XorByteString'memory'arguments'slope
- | ComplementByteString'cpu'arguments'intercept
- | ComplementByteString'cpu'arguments'slope
- | ComplementByteString'memory'arguments'intercept
- | ComplementByteString'memory'arguments'slope
- | ReadBit'cpu'arguments
- | ReadBit'memory'arguments
- | WriteBits'cpu'arguments'intercept
- | WriteBits'cpu'arguments'slope
- | WriteBits'memory'arguments'intercept
- | WriteBits'memory'arguments'slope
- | ReplicateByte'cpu'arguments'intercept
- | ReplicateByte'cpu'arguments'slope
- | ReplicateByte'memory'arguments'intercept
- | ReplicateByte'memory'arguments'slope
- | ShiftByteString'cpu'arguments'intercept
- | ShiftByteString'cpu'arguments'slope
- | ShiftByteString'memory'arguments'intercept
- | ShiftByteString'memory'arguments'slope
- | RotateByteString'cpu'arguments'intercept
- | RotateByteString'cpu'arguments'slope
- | RotateByteString'memory'arguments'intercept
- | RotateByteString'memory'arguments'slope
- | CountSetBits'cpu'arguments'intercept
- | CountSetBits'cpu'arguments'slope
- | CountSetBits'memory'arguments
- | FindFirstSetBit'cpu'arguments'intercept
- | FindFirstSetBit'cpu'arguments'slope
- | FindFirstSetBit'memory'arguments
- | Ripemd_160'cpu'arguments'intercept
- | Ripemd_160'cpu'arguments'slope
- | Ripemd_160'memory'arguments
- data CostModelApplyError
- type CostModelParams = Map Text Int64
- assertWellFormedCostModelParams ∷ MonadError CostModelApplyError m ⇒ CostModelParams → m ()
- data ScriptContext = ScriptContext {}
- data ScriptPurpose
- data ScriptInfo
- data BuiltinByteString
- toBuiltin ∷ HasToBuiltin a ⇒ a → ToBuiltin a
- fromBuiltin ∷ HasFromBuiltin arep ⇒ arep → FromBuiltin arep
- toOpaque ∷ HasToOpaque a arep ⇒ a → arep
- fromOpaque ∷ HasFromOpaque arep a ⇒ arep → a
- newtype LedgerBytes = LedgerBytes {}
- fromBytes ∷ ByteString → LedgerBytes
- data StakingCredential
- data Credential
- newtype Value = Value {}
- newtype CurrencySymbol = CurrencySymbol {}
- newtype TokenName = TokenName {}
- singleton ∷ CurrencySymbol → TokenName → Integer → Value
- unionWith ∷ (Integer → Integer → Integer) → Value → Value → Value
- adaSymbol ∷ CurrencySymbol
- adaToken ∷ TokenName
- newtype Lovelace = Lovelace {}
- newtype POSIXTime = POSIXTime {}
- type POSIXTimeRange = Interval POSIXTime
- data Address = Address {}
- newtype PubKeyHash = PubKeyHash {}
- newtype TxId = TxId {}
- data TxInfo = TxInfo {
- txInfoInputs ∷ [TxInInfo]
- txInfoReferenceInputs ∷ [TxInInfo]
- txInfoOutputs ∷ [TxOut]
- txInfoFee ∷ Lovelace
- txInfoMint ∷ Value
- txInfoTxCerts ∷ [TxCert]
- txInfoWdrl ∷ Map Credential Lovelace
- txInfoValidRange ∷ POSIXTimeRange
- txInfoSignatories ∷ [PubKeyHash]
- txInfoRedeemers ∷ Map ScriptPurpose Redeemer
- txInfoData ∷ Map DatumHash Datum
- txInfoId ∷ TxId
- txInfoVotes ∷ Map Voter (Map GovernanceActionId Vote)
- txInfoProposalProcedures ∷ [ProposalProcedure]
- txInfoCurrentTreasuryAmount ∷ Maybe Lovelace
- txInfoTreasuryDonation ∷ Maybe Lovelace
- data TxOut = TxOut {}
- data TxOutRef = TxOutRef {}
- data TxInInfo = TxInInfo {}
- data OutputDatum
- data Interval a = Interval {
- ivFrom ∷ LowerBound a
- ivTo ∷ UpperBound a
- data Extended a
- type Closure = Bool
- data UpperBound a = UpperBound (Extended a) Closure
- data LowerBound a = LowerBound (Extended a) Closure
- always ∷ Interval a
- from ∷ a → Interval a
- to ∷ a → Interval a
- lowerBound ∷ a → LowerBound a
- upperBound ∷ a → UpperBound a
- strictLowerBound ∷ a → LowerBound a
- strictUpperBound ∷ a → UpperBound a
- data Rational
- ratio ∷ Integer → Integer → Maybe Rational
- fromGHC ∷ Rational → Rational
- toGHC ∷ Rational → Rational
- data Map k v
- unsafeFromList ∷ [(k, v)] → Map k v
- newtype ScriptHash = ScriptHash {}
- newtype Redeemer = Redeemer {}
- newtype RedeemerHash = RedeemerHash BuiltinByteString
- newtype Datum = Datum {}
- newtype DatumHash = DatumHash BuiltinByteString
- data Data
- data BuiltinData = BuiltinData ~Data
- class ToData a where
- toBuiltinData ∷ a → BuiltinData
- class FromData a where
- fromBuiltinData ∷ BuiltinData → Maybe a
- class UnsafeFromData a where
- toData ∷ ToData a ⇒ a → Data
- fromData ∷ FromData a ⇒ Data → Maybe a
- unsafeFromData ∷ UnsafeFromData a ⇒ Data → a
- dataToBuiltinData ∷ Data → BuiltinData
- builtinDataToData ∷ BuiltinData → Data
- class Monad m ⇒ MonadError e (m ∷ Type → Type) | m → e
- data EvaluationError
- data ScriptDecodeError
Scripts
type SerialisedScript = ShortByteString Source #
Scripts to the ledger are serialised bytestrings.
data ScriptForEvaluation Source #
A Plutus script ready to be evaluated on-chain, via evaluateScriptRestricting
.
Instances
Generic ScriptForEvaluation Source # | |
Defined in PlutusLedgerApi.Common.SerialisedScript | |
Show ScriptForEvaluation Source # | |
Defined in PlutusLedgerApi.Common.SerialisedScript | |
NFData ScriptForEvaluation Source # | |
Defined in PlutusLedgerApi.Common.SerialisedScript rnf ∷ ScriptForEvaluation → () Source # | |
Eq ScriptForEvaluation Source # | |
NoThunks ScriptForEvaluation Source # | |
Defined in PlutusLedgerApi.Common.SerialisedScript | |
type Rep ScriptForEvaluation Source # | |
Defined in PlutusLedgerApi.Common.SerialisedScript type Rep ScriptForEvaluation = D1 ('MetaData "ScriptForEvaluation" "PlutusLedgerApi.Common.SerialisedScript" "plutus-ledger-api-1.36.0.0-inplace" 'False) (C1 ('MetaCons "UnsafeScriptForEvaluation" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SerialisedScript) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptNamedDeBruijn))) |
serialisedScript ∷ ScriptForEvaluation → SerialisedScript Source #
Get a SerialisedScript
from a ScriptForEvaluation
. O(1).
deserialisedScript ∷ ScriptForEvaluation → ScriptNamedDeBruijn Source #
Get a ScriptNamedDeBruijn
from a ScriptForEvaluation
. O(1).
serialiseCompiledCode ∷ ∀ a. CompiledCode a → SerialisedScript Source #
Turns a program which was compiled using the 'PlutusTx' toolchain into a binary format that is understood by the network and can be stored on-chain.
serialiseUPLC ∷ Program DeBruijn DefaultUni DefaultFun () → SerialisedScript Source #
Turns a program's AST (most likely manually constructed) into a binary format that is understood by the network and can be stored on-chain.
∷ ∀ m. MonadError ScriptDecodeError m | |
⇒ MajorProtocolVersion | which major protocol version the script was submitted in. |
→ SerialisedScript | the script to deserialise. |
→ m ScriptForEvaluation |
The deserialization from a serialised script into a ScriptForEvaluation
,
ready to be evaluated on-chain.
Called inside phase-1 validation (i.e., deserialisation error is a phase-1 error).
uncheckedDeserialiseUPLC ∷ SerialisedScript → Program DeBruijn DefaultUni DefaultFun () Source #
Deserialises a SerialisedScript
back into an AST. Does *not* do
ledger-language-version-specific checks like for allowable builtins.
Running scripts
evaluateScriptRestricting Source #
∷ MajorProtocolVersion | Which protocol version to run the operation in |
→ VerboseMode | Whether to produce log output |
→ EvaluationContext | Includes the cost model to use for tallying up the execution costs |
→ ExBudget | The resource budget which must not be exceeded during evaluation |
→ ScriptForEvaluation | The script to evaluate |
→ Data | The |
→ (LogOutput, Either EvaluationError ExBudget) |
Evaluates a script, with a cost model and a budget that restricts how many resources it can use according to the cost model. Also returns the budget that was actually used.
Can be used to calculate budgets for scripts, but even in this case you must give a limit to guard against scripts that run for a long time or loop.
evaluateScriptCounting Source #
∷ MajorProtocolVersion | Which protocol version to run the operation in |
→ VerboseMode | Whether to produce log output |
→ EvaluationContext | Includes the cost model to use for tallying up the execution costs |
→ ScriptForEvaluation | The script to evaluate |
→ Data | The |
→ (LogOutput, Either EvaluationError ExBudget) |
Evaluates a script, returning the minimum budget that the script would need
to evaluate successfully. This will take as long as the script takes, if you need to
limit the execution time of the script also, you can use evaluateScriptRestricting
, which
also returns the used budget.
CIP-1694
newtype ColdCommitteeCredential Source #
Instances
newtype HotCommitteeCredential Source #
Instances
newtype DRepCredential Source #
Instances
Instances
Instances
TxCertRegStaking Credential (Maybe Lovelace) | Register staking credential with an optional deposit amount |
TxCertUnRegStaking Credential (Maybe Lovelace) | Un-Register staking credential with an optional refund amount |
TxCertDelegStaking Credential Delegatee | Delegate staking credential to a Delegatee |
TxCertRegDeleg Credential Delegatee Lovelace | Register and delegate staking credential to a Delegatee in one certificate. Note that deposit is mandatory. |
TxCertRegDRep DRepCredential Lovelace | Register a DRep with a deposit value. The optional anchor is omitted. |
TxCertUpdateDRep DRepCredential | Update a DRep. The optional anchor is omitted. |
TxCertUnRegDRep DRepCredential Lovelace | UnRegister a DRep with mandatory refund value |
TxCertPoolRegister | A digest of the PoolParams |
| |
TxCertPoolRetire PubKeyHash Integer | The retirement certificate and the Epoch in which the retirement will take place |
TxCertAuthHotCommittee ColdCommitteeCredential HotCommitteeCredential | Authorize a Hot credential for a specific Committee member's cold credential |
TxCertResignColdCommittee ColdCommitteeCredential |
Instances
Instances
A vote. The optional anchor is omitted.
Instances
data GovernanceActionId Source #
Similar to TxOutRef, but for GovActions
Instances
Committee | |
|
Instances
newtype Constitution Source #
A constitution. The optional anchor is omitted.
Instances
data ProtocolVersion Source #
Instances
data GovernanceAction Source #
ParameterChange (Maybe GovernanceActionId) ChangedParameters (Maybe ScriptHash) | Hash of the constitution script |
HardForkInitiation (Maybe GovernanceActionId) ProtocolVersion | proposal to update protocol version |
TreasuryWithdrawals (Map Credential Lovelace) (Maybe ScriptHash) | Hash of the constitution script |
NoConfidence (Maybe GovernanceActionId) | |
UpdateCommittee | |
| |
NewConstitution (Maybe GovernanceActionId) Constitution | |
InfoAction |
Instances
newtype ChangedParameters Source #
A Plutus Data object containing proposed parameter changes. The Data object contains
a Map
with one entry per changed parameter, from the parameter ID to the new value.
Unchanged parameters are not included.
The mapping from parameter IDs to parameters can be found in conway.cddl.
Invariant: This map is non-empty, and the keys are stored in ascending order.
This Data
object has the following format (in pseudocode):
ChangedParametersData = Map ChangedIdData ChangedManyValueData ChangedIdData = I Integer ChangedManyValueData = ChangedSingleValueData | List[ChangedSingleValueData...] -- ^ an arbitrary-length, heterogeneous (integer or ratio) list of values (to support sub-parameters)
ChangedSingleValueData = I Integer -- a proposed integer value | List[I Integer, I Integer] -- a proposed numerator,denominator (ratio value) -- ^ a 2-exact element list; *BE CAREFUL* because this can be alternatively (ambiguously) interpreted -- as a many-value data (sub-parameter) of two integer single-value data.
, where Map,I,List are the constructors of Data
and Integer is the usual arbitrary-precision PlutusTx/Haskell Integer.
Instances
data ProposalProcedure Source #
A proposal procedure. The optional anchor is omitted.
Instances
Protocol version
newtype MajorProtocolVersion Source #
This represents the major component of the Cardano protocol version. The ledger can only supply the major component of the protocol version, not the minor component, and Plutus should only need to care about the major component anyway. This relies on careful understanding between us and the ledger as to what this means.
Instances
Verbose mode and log output
data VerboseMode Source #
A simple toggle indicating whether or not we should accumulate logs during script execution.
Instances
Eq VerboseMode Source # | |
Defined in PlutusLedgerApi.Common.Eval (==) ∷ VerboseMode → VerboseMode → Bool Source # (/=) ∷ VerboseMode → VerboseMode → Bool Source # |
type LogOutput = [Text] Source #
The type of the executed script's accumulated log output: a list of Text
.
It will be an empty list if the VerboseMode
is set to Quiet
.
Costing-related types
Instances
Counts CPU units in picoseconds: maximum value for SatInt is 2^63 ps, or appproximately 106 days.
Instances
FromJSON ExCPU | |
Defined in PlutusCore.Evaluation.Machine.ExMemory | |
ToJSON ExCPU | |
Defined in PlutusCore.Evaluation.Machine.ExMemory | |
Monoid ExCPU | |
Semigroup ExCPU | |
Bounded ExCPU | |
Generic ExCPU | |
Num ExCPU | |
Read ExCPU | |
Show ExCPU | |
NFData ExCPU | |
Defined in PlutusCore.Evaluation.Machine.ExMemory | |
Eq ExCPU | |
Ord ExCPU | |
Defined in PlutusCore.Evaluation.Machine.ExMemory | |
NoThunks ExCPU | |
Pretty ExCPU | |
Serialise ExCPU | |
PrettyBy config ExCPU | |
Lift ExCPU | |
type Rep ExCPU | |
Defined in PlutusCore.Evaluation.Machine.ExMemory type Rep ExCPU = D1 ('MetaData "ExCPU" "PlutusCore.Evaluation.Machine.ExMemory" "plutus-core-1.36.0.0-inplace" 'True) (C1 ('MetaCons "ExCPU" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostingInteger))) |
Counts size in machine words.
Instances
Instances
fromSatInt ∷ Num a ⇒ SatInt → a Source #
An optimized version of fromIntegral . unSatInt
.
Cost model
data EvaluationContext Source #
An opaque type that contains all the static parameters that the evaluator needs to evaluate a script. This is so that they can be computed once and cached, rather than being recomputed on every evaluation.
Different protocol versions may require different bundles of machine parameters, which allows us for
example to tweak the shape of the costing function of a builtin, so that the builtin costs less.
Currently this means that we have to create multiple DefaultMachineParameters
per language
version, which we put into a cache (represented by an association list) in order to avoid costly
recomputation of machine parameters.
In order to get the appropriate DefaultMachineParameters
at validation time we look it up in the
cache using a semantics variant as a key. We compute the semantics variant from the protocol
version using the stored function. Note that the semantics variant depends on the language version
too, but the latter is known statically (because each language version has its own evaluation
context), hence there's no reason to require it to be provided at runtime.
To say it differently, there's a matrix of semantics variants indexed by (LL, PV) pairs and we
cache its particular row corresponding to the statically given LL in an EvaluationContext
.
The reason why we associate a DefaultMachineParameters
with a semantics variant rather than a
protocol version are
- generally there are far more protocol versions than semantics variants supported by a specific language version, so we save on pointless duplication of bundles of machine parameters
- builtins don't know anything about protocol versions, only semantics variants. It is therefore more semantically precise to associate bundles of machine parameters with semantics variants than with protocol versions
Instances
∷ (MonadError CostModelApplyError m, MonadWriter [CostModelApplyWarn] m) | |
⇒ [Int64] | the (updated) cost model parameters of the protocol |
→ m EvaluationContext |
Build the EvaluationContext
.
The input is a list of cost model parameters (which are integer values) passed from the ledger.
IMPORTANT: the cost model parameters MUST appear in the correct order,
matching the names in ParamName
. If the parameters are
supplied in the wrong order then script cost calculations will be incorrect.
IMPORTANT: The evaluation context of every Plutus version must be recreated upon a protocol update with the updated cost model parameters.
The enumeration of all possible cost model parameter names for this language version.
IMPORTANT: The order of appearance of the data constructors here matters. DO NOT REORDER. See Note [Quotation marks in cost model parameter constructors] See Note [Cost model parameters from the ledger's point of view]