CompiledPlutus

scalus.uplc.CompiledPlutus
sealed abstract class CompiledPlutus[A](val lazyCode: () => A, val sir: SIR, val options: Options, val optimizer: Optimizer) extends Compiled[A]

Base implementation for compiled Plutus scripts of all versions.

This sealed abstract class provides the common implementation for compiling Scala code to Plutus scripts across all Plutus language versions (V1, V2, V3). Subclasses implement version-specific details such as program version numbers, script hash prefixes, and optimizer selection.

Type parameters

A

the Scala type of the compiled code

Value parameters

lazyCode

a thunk that evaluates to the original Scala code

optimizer

the UPLC optimizer to apply (version-specific)

options

compiler options controlling lowering and optimization

sir

the Scalus Intermediate Representation

Attributes

Graph
Supertypes
trait Compiled[A]
class Object
trait Matchable
class Any
Known subtypes
class PlutusV1[A]
class PlutusV2[A]
class PlutusV3[A]

Members list

Value members

Abstract methods

The Plutus language version.

The Plutus language version.

Attributes

protected def makeProgram(term: Term): Program

Creates the program with the appropriate version.

Creates the program with the appropriate version.

Attributes

protected def makeScript(program: Program): PlutusScript

Creates the script with the appropriate version.

Creates the script with the appropriate version.

Attributes

Concrete methods

def code: A

Evaluates and returns the original Scala code.

Evaluates and returns the original Scala code.

Attributes

protected def toUplc: Term

Lowers the SIR to UPLC using the configured backend and applies optimization if enabled.

Lowers the SIR to UPLC using the configured backend and applies optimization if enabled.

Attributes

Inherited methods

def address(network: Network): Address

Derives a Cardano address for this script on the specified network.

Derives a Cardano address for this script on the specified network.

Value parameters

network

the Cardano network (Mainnet or Testnet)

Attributes

Returns

the script address

Inherited from:
Compiled

Concrete fields

val lazyCode: () => A

The compiler options used during compilation.

The compiler options used during compilation.

Attributes

lazy val program: Program

The compiled UPLC program. Lazily computed on first access.

The compiled UPLC program. Lazily computed on first access.

Attributes

lazy val script: PlutusScript

The Plutus script in its serialized form. Lazily computed on first access.

The Plutus script in its serialized form. Lazily computed on first access.

Attributes

val sir: SIR

The Scalus Intermediate Representation of the compiled code.

The Scalus Intermediate Representation of the compiled code.

Attributes