scalus.uplc
Members list
Packages
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
A compiled Plutus script.
A compiled Plutus script.
This trait represents a script that has been compiled from Scala source code through the Scalus compiler pipeline (Scala -> SIR -> UPLC -> Plutus Script). It contains original Scala code, its type, scalus.compiler.sir.SIR, compiler options (backend etc), and generated UPLC program and serialized Plutus script.
Type parameters
- A
-
the Scala type of the compiled code, typically a function type representing the validator signature
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Base implementation for compiled Plutus scripts of all versions.
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
- Supertypes
- Known subtypes
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Arrayclass BLS12_381_G1_Elementclass BLS12_381_G2_Elementclass BLS12_381_MlResultclass Boolclass BuiltinValueclass ByteStringclass Dataclass Integerclass Listclass Pairclass Stringobject UnitShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DeBruijn.type
A De Bruijn-indexed program.
A De Bruijn-indexed program.
A De Bruijn-indexed program is a versioned Term where the variables are indexed using De Bruijn indices. A program must be De Bruijn-indexed before it can be evaluated.
Value parameters
- term
-
the term of the program
- version
-
the version of the program
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
DeBruijnedProgram.type
Plutus Core built-in functions.
Plutus Core built-in functions.
This enum defines all available built-in functions in Untyped Plutus Core (UPLC). Built-in functions provide primitive operations that cannot be expressed in the lambda calculus itself, such as arithmetic, cryptographic operations, and data structure manipulation.
==Plutus Version Compatibility==
Built-in functions are available in different Plutus versions:
- '''Plutus V1''': Original set of builtins (integers, bytestrings, strings, Data, etc.)
- '''Plutus V2''': Added
SerialiseData - '''Plutus V3''': Added BLS12-381, bitwise operations, integer/bytestring conversions, additional hash functions (CIP-381, CIP-121, CIP-122, CIP-123, CIP-127)
- '''Plutus V4''': Added array builtins, MaryEraValue builtins, DropList (CIP-153, CIP-156, CIP-158)
==Type Signatures==
Built-in functions have specific type signatures. Polymorphic builtins require explicit type instantiation via force before application.
==Categories==
The builtins are organized into the following categories:
- '''Integer operations''': Arithmetic and comparison on arbitrary-precision integers
- '''ByteString operations''': Manipulation of byte arrays
- '''Cryptographic functions''': Hashing and signature verification
- '''String operations''': UTF-8 string manipulation
- '''Control flow''': Conditionals and unit handling
- '''Pairs and Lists''': Data structure operations
- '''Data type''': Operations on the universal
Datatype - '''BLS12-381''': Pairing-friendly elliptic curve operations (Plutus V3+)
- '''Bitwise operations''': Bit-level manipulation of bytestrings (Plutus V3+)
- '''Value operations''': Multi-asset value manipulation (Plutus V4+)
Attributes
- See also
-
scalus.uplc.builtin.Builtins for the Scala implementations
- Companion
- object
- Supertypes
-
trait Enumtrait Producttrait Equalsclass Enum[DefaultFun]trait Serializabletrait Comparable[DefaultFun]trait Constableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- enum
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
DefaultFun.type
Attributes
- Supertypes
-
trait Ordering[DefaultFun]trait PartialOrdering[DefaultFun]trait Equiv[DefaultFun]trait Serializabletrait Comparator[DefaultFun]class Objecttrait Matchableclass AnyShow all
- Self type
-
DefaultFunOrdering.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Applyobject BLS12_381_G1_Elementobject BLS12_381_G2_Elementobject BLS12_381_MlResultobject BuiltinValueobject Dataclass LiftedUni[A]object Boolobject ByteStringobject Integerobject Stringobject Unitobject ProtoArrayobject ProtoListobject ProtoPairShow all
Attributes
- Companion
- class
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
DefaultUni.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ExprBuilder.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
A compiled Plutus V1 script.
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
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass CompiledPlutus[A]trait Compiled[A]class Objecttrait Matchableclass AnyShow all
Plutus V1 cost model parameters.
Plutus V1 cost model parameters.
The names of the fields are taken from https://github.com/input-output-hk/plutus/blob/1.40.0.0/plutus-ledger-api/src/PlutusLedgerApi/V1/ParamName.hs and Blockfrost Protocol Parameters JSON uses these names as well in blockfrost-params-epoch-544.json
But what's really important is the order of the fields because that's the order of the parameters in the protocol parameters array.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PlutusV1Params.type
A compiled Plutus V2 script.
A compiled Plutus V2 script.
Plutus V2 was introduced in the Vasil hard fork. It adds reference inputs, inline datums, reference scripts, and the SerialiseData builtin.
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 = PlutusV2.compile((datum: Data, redeemer: Data, ctx: Data) => ...) val scriptHash = validator.script.scriptHash - Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass CompiledPlutus[A]trait Compiled[A]class Objecttrait Matchableclass AnyShow all
Plutus V2 cost model parameters.
Plutus V2 cost model parameters.
The names of the fields are taken from https://github.com/input-output-hk/plutus/blob/1.40.0.0/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs and Blockfrost Protocol Parameters JSON uses these names as well in blockfrost-params-epoch-544.json
But what's really important is the order of the fields because that's the order of the parameters in the protocol parameters array.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PlutusV2Params.type
A compiled Plutus V3 script.
A compiled Plutus V3 script.
This is the primary type for working with compiled Cardano smart contracts in Scalus. It holds the intermediate representation (SIR), compilation options, and lazily computes the final UPLC program and script.
Plutus V3 was introduced in the Conway hard fork. It adds BLS12-381 elliptic curve operations, bitwise primitives, and more efficient case/constr optimization.
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 = PlutusV3.compile((datum: Data) => ...) val scriptHash = validator.script.scriptHash val address = validator.address(Network.Testnet) - Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass CompiledPlutus[A]trait Compiled[A]class Objecttrait Matchableclass AnyShow all
Plutus V3 cost model parameters.
Plutus V3 cost model parameters.
The names of the fields are taken from https://github.com/input-output-hk/plutus/blob/1.40.0.0/plutus-ledger-api/src/PlutusLedgerApi/V3/ParamName.hs and Blockfrost Protocol Parameters JSON uses these names as well in blockfrost-params-epoch-544.json
But what's really important is the order of the fields because that's the order of the parameters in the protocol parameters array.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PlutusV3Params.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PlutusV4Params.type
A Cardano Plutus program.
A Cardano Plutus program.
A program is a versioned Term. The version is a tuple of three integers: major, minor, and patch.
Value parameters
- term
-
the term of the program
- version
-
the version of the program
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ProgramFlatCodec.type
Sanitizes UPLC Terms to ensure all variable names conform to the UPLC text format requirements.
Sanitizes UPLC Terms to ensure all variable names conform to the UPLC text format requirements.
UPLC text format only allows:
- First character: letters (a-z, A-Z) or underscore (_)
- Subsequent characters: letters, digits, underscore (_), or apostrophe (')
- Optional suffix: hyphen followed by digits (-\d+)
This sanitizer transforms variable names to comply with these rules while avoiding conflicts.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TermSanitizer.type
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Cardano uplc CLI interface
Cardano uplc CLI interface
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
UplcCli.type
Represents the result of evaluating a UPLC program using uplc CLI
Represents the result of evaluating a UPLC program using uplc CLI
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
UPLC parsers.
UPLC parsers.
It's a collection of parsers for the UPLC language. Term and Program parsers are statefull and are program version dependent, that's why this is a class and not an object.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
UplcParser.type