Program

scalus.uplc.Program
See theProgram companion class
object Program

Attributes

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

Members list

Type members

Classlikes

Pretty[Program] instance

Pretty[Program] instance

Attributes

Supertypes
trait Pretty[Program]
class Object
trait Matchable
class Any
Self type

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

def fromCbor(cbor: Array[Byte]): Program

Deserializes a program from a CBOR-encoded byte array.

Deserializes a program from a CBOR-encoded byte array.

Value parameters

cbor

the CBOR-encoded byte array

Attributes

Returns

the program

Deserializes a program from a CBOR-encoded scalus.uplc.builtin.ByteString.

Deserializes a program from a CBOR-encoded scalus.uplc.builtin.ByteString.

Value parameters

cbor

the CBOR-encoded ByteString

Attributes

Returns

the program

def fromCborHex(cborHex: String): Program

Deserializes a program from a CBOR-encoded hex string.

Deserializes a program from a CBOR-encoded hex string.

Value parameters

cborHex

the CBOR-encoded hex string

Attributes

Returns

the program

def fromDoubleCborHex(doubleCborHex: String): Program

Deserializes a program from a double-CBOR-encoded hex string.

Deserializes a program from a double-CBOR-encoded hex string.

Value parameters

doubleCborHex

the double-CBOR-encoded hex string

Attributes

Returns

the program

def fromFlatEncoded(flatEncoded: Array[Byte]): Program

Deserializes a program from a flat-encoded byte array.

Deserializes a program from a flat-encoded byte array.

Attributes

def minVersionFor(term: Term): (Int, Int, Int)

The lowest UPLC version that can carry term: 1.1.0 if it uses constr/case, else 1.0.0.

The lowest UPLC version that can carry term: 1.1.0 if it uses constr/case, else 1.0.0.

The UPLC version field gates exactly one thing: whether constr/case are legal syntax. Builtins are gated by the ledger language and protocol version, never by the program version. So the version a PlutusV1/V2 program should declare is a property of its term, not of the target it was compiled for: a constr-free term is valid as 1.0.0 at every protocol version, and a term with constr/case needs 1.1.0 - which PlutusV1/V2 only carry from the van Rossem hard fork on (plcVersionsIntroducedIn in plutus-ledger-api). Declaring 1.1.0 on a constr-free term would only make it unusable below protocol version 11 and change its hash for nothing; declaring 1.0.0 on a term with constr/case is rejected by the Plutus decoder, and by ProgramFlatCodec.encodeFlat.

PlutusV3 always declares 1.1.0: it had it from the day it was introduced.

Attributes

def parseUplc(s: String): Either[String, Program]

Parse UPLC program from string using the default version (1, 1, 0)

Parse UPLC program from string using the default version (1, 1, 0)

Attributes

def parseUplc(s: String, version: (Int, Int, Int)): Either[String, Program]

Parse UPLC program from string using a specific version

Parse UPLC program from string using a specific version

Attributes

def plutusV1(term: Term): Program

Wraps term in a PlutusV1 program at the lowest version that can carry it, see minVersionFor.

Wraps term in a PlutusV1 program at the lowest version that can carry it, see minVersionFor.

Attributes

def plutusV2(term: Term): Program

Wraps term in a PlutusV2 program at the lowest version that can carry it, see minVersionFor.

Wraps term in a PlutusV2 program at the lowest version that can carry it, see minVersionFor.

Attributes

def plutusV3(term: Term): Program

Givens

Givens

Pretty[Program] instance

Pretty[Program] instance

Attributes