Factory methods for creating compiled Plutus V1 scripts.
Attributes
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
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
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