PlutusScriptEvaluationException

scalus.cardano.ledger.PlutusScriptEvaluationException
See thePlutusScriptEvaluationException companion object
class PlutusScriptEvaluationException(message: String, cause: Throwable, val logs: Array[String], val failedScriptHash: ScriptHash, val spentBudget: ExUnits, val failedSourcePosition: Option[ScalusSourcePos], val redeemer: Option[Redeemer], val script: Option[PlutusScript], val args: Seq[Data]) extends RuntimeException

Plutus script evaluation exception during phase-2 validation of a transaction.

Thrown by PlutusScriptEvaluator when the script of redeemer fails: it evaluates error, exhausts its budget, gets an error from a builtin, or (Plutus V3) returns something other than unit. getCause says which. A cause that is not a scalus.uplc.eval.MachineError is a defect in Scalus, not a problem with the script.

Spend[0] failed: Error term evaluated
script: 5a4b…e1
spent budget: { mem: 12031, steps: 4830112 }
logs:
checking signatures

To run the failing script again on its own:

given PlutusVM = PlutusVM.makePlutusV3VM()
e.args.foldLeft(e.script.get.deBruijnedProgram)(_.applyArg(_)).evaluateDebug

redeemer and script are None, and args is empty, only for an exception built through the pre-1.3 constructor.

Attributes

Companion
object
Graph
Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(message: String, cause: Throwable, logs: Array[String], failedScriptHash: ScriptHash, spentBudget: ExUnits, failedSourcePosition: Option[ScalusSourcePos] = ...)

The constructor of releases before 1.3: no redeemer, no script, no arguments.

The constructor of releases before 1.3: no redeemer, no script, no arguments.

Attributes

Inherited methods

final def addSuppressed(x$0: Throwable): Unit

Attributes

Inherited from:
Throwable
def fillInStackTrace(): Throwable

Attributes

Inherited from:
Throwable
def getCause(): Throwable

Attributes

Inherited from:
Throwable
def getLocalizedMessage(): String

Attributes

Inherited from:
Throwable
def getMessage(): String

Attributes

Inherited from:
Throwable
def getStackTrace(): Array[StackTraceElement]

Attributes

Inherited from:
Throwable
final def getSuppressed(): Array[Throwable]

Attributes

Inherited from:
Throwable
def initCause(x$0: Throwable): Throwable

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintWriter): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintStream): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(): Unit

Attributes

Inherited from:
Throwable
def setStackTrace(x$0: Array[StackTraceElement]): Unit

Attributes

Inherited from:
Throwable
def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Inherited from:
Throwable

Concrete fields

val args: Seq[Data]
val logs: Array[String]
val redeemer: Option[Redeemer]
val script: Option[PlutusScript]