Factory methods for creating compiled Plutus V3 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 V3 script.
Compiles Scala code to a Plutus V3 script.
This is the main entry point for compiling Cardano smart contracts. 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 PlutusV3 containing the compiled script
- Example
-
given scalus.compiler.Options = scalus.compiler.Options.release val validator = PlutusV3.compile { (datum: 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.
The argument is converted to a UPLC constant and applied to the SIR representation, resulting in a specialized script with the parameter baked in.
Value parameters
- arg
-
the argument to apply, must have a Constant.LiftValue instance
Attributes
- Returns
-
a new PlutusV3 with the argument applied