PlutusV1

scalus.uplc.PlutusV1
See thePlutusV1 companion object
final case class PlutusV1[A] extends CompiledPlutus[A]

A compiled Plutus V1 script.

Plutus V1 was introduced in the Alonzo hard fork. It provides basic smart contract functionality with the original set of builtin functions.

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 (if optimization is enabled)

options

compiler options controlling lowering and optimization

sir

the Scalus Intermediate Representation

Attributes

Example
 given scalus.compiler.Options = scalus.compiler.Options.release
 val validator = PlutusV1.compile((datum: Data, redeemer: Data, ctx: Data) => ...)
 val scriptHash = validator.script.scriptHash
Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class CompiledPlutus[A]
trait Compiled[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply: PlutusV1[B]
Extension method from PlutusV1

Applies an argument to a compiled function, producing a new compiled script.

Applies an argument to a compiled function, producing a new compiled script.

Value parameters

arg

the argument to apply, must have a Constant.LiftValue instance

Attributes

Returns

a new PlutusV1 with the argument applied

Returns scalus.cardano.ledger.Language.PlutusV1.

Returns scalus.cardano.ledger.Language.PlutusV1.

Attributes

Returns a copy of this compiled script with error traces enabled.

Returns a copy of this compiled script with error traces enabled.

Error traces provide detailed error messages during script evaluation, useful for debugging. This increases script size and execution cost.

Attributes

Returns

a new PlutusV1 with generateErrorTraces = true

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
def code: A

Evaluates and returns the original Scala code.

Evaluates and returns the original Scala code.

Attributes

Inherited from:
CompiledPlutus
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
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 from:
CompiledPlutus

Concrete fields

lazy override val script: PlutusV1

The serialized Plutus V1 script. Lazily computed on first access.

The serialized Plutus V1 script. Lazily computed on first access.

Attributes

Inherited fields

lazy val program: Program

The compiled UPLC program. Lazily computed on first access.

The compiled UPLC program. Lazily computed on first access.

Attributes

Inherited from:
CompiledPlutus