PlutusV1

scalus.uplc.PlutusV1
See thePlutusV1 companion class
object PlutusV1

Factory methods for creating compiled Plutus V1 scripts.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
PlutusV1.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

inline def compile[A](inline code: A)(using opts: Options): PlutusV1[A]

Compiles Scala code to a Plutus V1 script.

Compiles Scala code to a Plutus V1 script.

The code is compiled at compile-time using the Scalus compiler plugin.

Type parameters

A

the type of the code being compiled

Value parameters

code

the Scala code to compile (must be within the Scalus-supported subset)

opts

compiler options controlling compilation, lowering, and optimization

Attributes

Returns

a PlutusV1 containing the compiled script

Example
 given scalus.compiler.Options = scalus.compiler.Options.release
 val validator = PlutusV1.compile { (datum: Data, redeemer: Data, ctx: Data) =>
   val d = datum.to[MyDatum]
   require(d.value > 0)
 }

Extensions

Extensions

extension [A, B](self: PlutusV1[A => B])(implicit evidence$1: LiftValue[A])
def apply: PlutusV1[B]

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