Plutus.V1.Ledger.EvaluationContext

  • 1. πŸ“œ Overview

  • 2. πŸ”§ LANGUAGE PRAGMAS, OPTIONS, AND IMPORTS

  • 3. πŸ—„οΈ Type Synonyms and Data Types

    • 3.1 πŸ”€ SerializedScript (type)

    • 3.2 πŸ“Š LedgerPlutusVersion (data)

    • 3.3 πŸ”’ ProtocolVersion (data)

    • 3.4 πŸ§ͺ EvaluationError (data)

    • 3.5 πŸ”„ VerboseMode (data)

    • 3.6 πŸ› οΈ ScriptForExecution (newtype)

    • 3.7 πŸ—οΈ EvaluationContext (data)

  • 4. βš™οΈ Core Functions

    • 4.1 πŸ“œ builtinsIntroducedIn

    • 4.2 πŸ” builtinsAvailableIn

    • 4.3 πŸ› οΈ scriptCBORDecoder

    • 4.4 βœ… isScriptWellFormed

    • 4.5 βš™οΈ mkTermToEvaluate

    • 4.6 πŸ”„ unliftingModeIn

    • 4.7 πŸ”§ toMachineParameters

    • 4.8 πŸ› οΈ mkMachineParametersFor

    • 4.9 πŸ—οΈ mkEvaluationContext

    • 4.10 βœ”οΈ assertWellFormedCostModelParams

    • 4.11 πŸš€ evaluateScriptRestricting

    • 4.12 🚨 evaluateScriptCounting

  • 5. 🀝 Typeclass Instances

  • 6. 🏭 On-Chain Derivations

  • 7. πŸ“š Glossary


1 πŸ“œ Overview

This updated Plutus.ApiCommon module variant adds StrictData to ensure all fields are strict, and retains the extensive evaluation and serialization tools:

  • Strict data fields to avoid laziness-related thunks.

  • Configures GHC simplifier tick budget.

  • Defines SerializedScript, versioning types, error types, logging, and evaluation context.

  • Core functions for decoding, checking well-formedness, and running scripts under cost constraints.


2 πŸ”§ LANGUAGE PRAGMAS, OPTIONS, AND IMPORTS

  • StrictData: makes all fields in data types strict by default.

  • -fsimpl-tick-factor: increases simplifier ticks.

  • Imports: identical to previous, importing Plutus Core, CBOR, control, and utility modules.


3 πŸ—„οΈ Type Synonyms and Data Types

3.1 πŸ”€ SerializedScript

3.2 πŸ“Š LedgerPlutusVersion

3.3 πŸ”’ ProtocolVersion

3.4 πŸ§ͺ EvaluationError

3.5 πŸ”„ VerboseMode

3.6 πŸ› οΈ ScriptForExecution

3.7 πŸ—οΈ EvaluationContext


4 βš™οΈ Core Functions

See Section 4 of the previous ApiCommon tutorial for detailed code, inputs, processing, and outputs. This variant is strictly data-strict but function signatures and behavior remain unchanged.


5 🀝 Typeclass Instances

Identical to the earlier walkthrough:

  • Ord for ProtocolVersion

  • Pretty for ProtocolVersion and EvaluationError

  • No change in instance definitions beyond strictness in data.


6 🏭 On-Chain Derivations

Same makeIsDataIndexed and makeLift calls as before; unaffected by StrictData.


7 πŸ“š Glossary

All terms match the previous glossary, with the addition of:

  • StrictData: pragma making all data fields strict, preventing thunks.

  • NoThunks: class ensuring absence of unexpected laziness in data structures.

Last updated