package ast
- Alphabetic
- By Inheritance
- ast
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class AND(input: Value[SCollection[SBoolean.type]]) extends Value[SBoolean.type] with Transformer[SCollection[SBoolean.type], SBoolean.type] with NotReadyValueBoolean with Product with Serializable
AND logical conjunction
- case class Append[IV <: SType](input: Value[SCollection[IV]], col2: Value[SCollection[IV]]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Puts the elements of other collection
col2
after the elements ofinput
collection (concatenation of two collections). - case class Apply(func: Value[SType], args: IndexedSeq[Value[SType]]) extends Value[SType] with Product with Serializable
ErgoTree node which represents application of function
func
to the given arguments.ErgoTree node which represents application of function
func
to the given arguments.- func
expression which evaluates to a function
- args
arguments of the function application
- case class ApplyTypes(input: Value[SType], tpeArgs: Seq[SType]) extends Value[SType] with Product with Serializable
Apply types for type parameters of input value.
- case class ArithOp[T <: SType](left: Value[T], right: Value[T], opCode: OpCode) extends Value[T] with TwoArgumentsOperation[T, T, T] with NotReadyValue[T] with Product with Serializable
Represents binary operation with the given opCode.
- abstract class ArithOpCompanion extends TwoArgumentOperationCompanion
NOTE: by-name argument is required for correct initialization order.
- case class AtLeast(bound: Value[SInt.type], input: Value[SCollection[SSigmaProp.type]]) extends Value[SSigmaProp.type] with Transformer[SCollection[SSigmaProp.type], SSigmaProp.type] with NotReadyValue[SSigmaProp.type] with Product with Serializable
Logical threshold.
Logical threshold. AtLeast has two inputs: integer bound and children same as in AND/OR. The result is true if at least bound children are true.
- case class BinAnd(left: BoolValue, right: BoolValue) extends Value[SBoolean.type] with Relation[SBoolean.type, SBoolean.type] with Product with Serializable
Logical AND with lazy right argument which is evaluated only if left == true.
Logical AND with lazy right argument which is evaluated only if left == true. If left argument is false, the right is guaranteed to NOT be evaluated
- case class BinOr(left: BoolValue, right: BoolValue) extends Value[SBoolean.type] with Relation[SBoolean.type, SBoolean.type] with Product with Serializable
Logical OR with lazy right argument which is evaluated only if left == false.
Logical OR with lazy right argument which is evaluated only if left == false. If left argument is true, the right is guaranteed to NOT be evaluated
- case class BinXor(left: BoolValue, right: BoolValue) extends Value[SBoolean.type] with Relation[SBoolean.type, SBoolean.type] with Product with Serializable
- case class BitInversion[T <: SType](input: Value[T]) extends Value[T] with OneArgumentOperation[T, T] with Product with Serializable
Not implemented in v4.x.
- case class BitOp[T <: SType](left: Value[T], right: Value[T], opCode: OpCode) extends Value[T] with TwoArgumentsOperation[T, T, T] with NotReadyValue[T] with Product with Serializable
ErgoTree node which represents a binary bit-wise operation with the given opCode.
- abstract class BitOpCompanion extends TwoArgumentOperationCompanion
NOTE: by-name argument is required for correct initialization order.
- case class Block(bindings: Seq[Val], result: SValue) extends Value[SType] with Product with Serializable
Frontend representation of a block of Val definitions.
Frontend representation of a block of Val definitions. { val x = ...; val y = ... } This node is not part of ErgoTree and hence have Undefined opCode.
- sealed trait BlockItem extends Value[SType] with NotReadyValue[SType]
- case class BlockValue(items: IndexedSeq[BlockItem], result: SValue) extends Value[SType] with NotReadyValue[SType] with Product with Serializable
The order of ValDefs in the block is used to assign ids to ValUse(id) nodes For all i: items(i).id == {number of ValDefs preceded in a graph} with respect to topological order.
The order of ValDefs in the block is used to assign ids to ValUse(id) nodes For all i: items(i).id == {number of ValDefs preceded in a graph} with respect to topological order. Specific topological order doesn't really matter, what is important is to preserve semantic linkage between ValUse(id) and ValDef with the corresponding id. This convention allow to valid serializing ids because we always serializing and deserializing in a fixed well defined order.
- case class BoolToSigmaProp(value: BoolValue) extends SigmaPropValue with Product with Serializable
Embedding of Boolean values to SigmaProp values.
Embedding of Boolean values to SigmaProp values. As an example, this operation allows boolean experesions to be used as arguments of
atLeast(..., sigmaProp(boolExpr), ...)
operation. During execution results to eitherTrueProp
orFalseProp
values of SigmaProp type. - trait BooleanTransformer[IV <: SType] extends Value[SBoolean.type] with Transformer[SCollection[IV], SBoolean.type]
Transforms a collection of values to a boolean (see Exists, ForAll).
- trait BooleanTransformerCompanion extends ValueCompanion
- case class ByIndex[V <: SType](input: Value[SCollection[V]], index: Value[SInt.type], default: Option[Value[V]] = None) extends Value[V] with Transformer[SCollection[V], V] with NotReadyValue[V] with Product with Serializable
The element of the collection or default value.
The element of the collection or default value. If an index is out of bounds (
i < 0 || i >= length
) thendefault
value is returned.- V
the type of elements
- input
the zero-based indexed collection
- index
the index of the requested element (zero-based)
- returns
the element at the given index or
default
value if index is out or bounds
- Exceptions thrown
ArrayIndexOutOfBoundsException
ifindex < 0
orlength <= index
- case class ByteArrayToBigInt(input: Value[SByteArray]) extends Value[SBigInt.type] with Transformer[SByteArray, SBigInt.type] with NotReadyValueBigInt with Product with Serializable
Convert SByteArray to SBigInt
- case class ByteArrayToLong(input: Value[SByteArray]) extends Value[SLong.type] with Transformer[SByteArray, SLong.type] with NotReadyValueLong with Product with Serializable
Convert SByteArray to SLong
- case class CalcBlake2b256(input: Value[SByteArray]) extends CalcHash with Product with Serializable
Calculate Blake2b hash from
input
- sealed abstract class CalcHash extends Value[SByteArray] with Transformer[SByteArray, SByteArray] with NotReadyValueByteArray
- case class CalcSha256(input: Value[SByteArray]) extends CalcHash with Product with Serializable
Calculate Sha256 hash from
input
- class CheckingSigmaBuilder extends StdSigmaBuilder
Builder which does checking of constraints on the numeric arguments of binary operations.
- case class CompanionDesc(companion: ValueCompanion) extends OperationDesc with Product with Serializable
Operation descriptor based on ValueCompanion.
- case class ConcreteCollection[V <: SType](items: Seq[Value[V]], elementType: V) extends EvaluatedValue[SCollection[V]] with EvaluatedCollection[V, SCollection[V]] with Product with Serializable
ErgoTree node which converts a collection of expressions into a collection of data values.
ErgoTree node which converts a collection of expressions into a collection of data values. Each data value of the resulting collection is obtained by evaluating the corresponding expression in
items
. All items must have the same type.- items
source collection of expressions
- elementType
type descriptor of elements in the resulting collection
- abstract class Constant[+S <: SType] extends EvaluatedValue[S]
Base class for all constant literals whose data value is already known and never changes.
Base class for all constant literals whose data value is already known and never changes.
- See also
ConstantNode
- case class ConstantNode[S <: SType](value: S.WrappedType, tpe: S) extends Constant[S] with Product with Serializable
ErgoTree node which represents data literals, i.e.
ErgoTree node which represents data literals, i.e. data values embedded in an expression.
- value
data value of the underlying Scala type
- tpe
type descriptor of the data value and also the type of the value represented by this node.
- See also
Constant
- case class ConstantPlaceholder[S <: SType](id: Int, tpe: S) extends Value[S] with Product with Serializable
Placeholder for a constant in ErgoTree.
Placeholder for a constant in ErgoTree. Zero based index in ErgoTree.constants array.
- abstract class CostItem extends AnyRef
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation.
- sealed abstract class CostKind extends AnyRef
Cost descriptor of a single operation, usually associated with OperationDesc.
- case class CreateAvlTree(operationFlags: ByteValue, digest: Value[SByteArray], keyLength: IntValue, valueLengthOpt: Value[SIntOption]) extends AvlTreeValue with Product with Serializable
Construct a new authenticated dictionary with given parameters and tree root digest.
- case class CreateProveDHTuple(gv: Value[SGroupElement.type], hv: Value[SGroupElement.type], uv: Value[SGroupElement.type], vv: Value[SGroupElement.type]) extends SigmaPropValue with Product with Serializable
ErgoTree operation to create a new SigmaProp value representing public key of Diffie Hellman signature protocol.
ErgoTree operation to create a new SigmaProp value representing public key of Diffie Hellman signature protocol. Common input: (g,h,u,v)
- case class CreateProveDlog(value: Value[SGroupElement.type]) extends SigmaPropValue with Product with Serializable
ErgoTree operation to create a new SigmaProp value representing public key of discrete logarithm signature protocol.
- case class DecodePoint(input: Value[SByteArray]) extends Value[SGroupElement.type] with Transformer[SByteArray, SGroupElement.type] with NotReadyValueGroupElement with Product with Serializable
Convert SByteArray to SGroupElement using CryptoConstants.dlogGroup.curve.decodePoint(bytes)
- trait Deserialize[V <: SType] extends Value[V] with NotReadyValue[V]
- case class DeserializeContext[V <: SType](id: Byte, tpe: V) extends Value[V] with Deserialize[V] with Product with Serializable
This ErgoTree operation work as macros (i.e.
This ErgoTree operation work as macros (i.e. executed before ErgoTree reduction) and allows to inline arbitrary expression at the point where it is used in ErgoTree.
This operation is executed before ErgoTree reduction as the following: 1) the context variable
id
is checked to have type Coll[Byte], if not, then this node remains in the ErgoTree which means the reduction will fail later. 2) the bytes collection is deserialized toexpr: Value[V]
using ValueSerializer.deserialize 3)this
node is replaced with the deserializedexpr
This step are performed for each DeserializeContext node via single traverse of ErgoTree. The resulting ErgoTree is passed to reduction.
NOTE, the original
Coll[Byte]
from context variables is available asgetVar[Coll[Byte]](id)
- id
identifier of the context variable
- tpe
expected type of the deserialized script (i.e. expected type of
expr
).
- case class DeserializeRegister[V <: SType](reg: RegisterId, tpe: V, default: Option[Value[V]] = None) extends Value[V] with Deserialize[V] with Product with Serializable
Extract register of SELF box as Coll[Byte], deserialize it into Value and inline into executing script.
Extract register of SELF box as Coll[Byte], deserialize it into Value and inline into executing script. NOTE: it only applicable to SELF box
- case class Downcast[T <: SNumericType, R <: SNumericType](input: Value[T], tpe: R) extends Value[R] with Transformer[T, R] with Product with Serializable
Down cast for Numeric types
- case class EQ[S <: SType](left: Value[S], right: Value[S]) extends Value[SBoolean.type] with SimpleRelation[S] with Product with Serializable
Equals operation for SType todo: make EQ to really accept only values of the same type, now EQ(TrueLeaf, IntConstant(5)) is valid
- case class ErgoTree extends Product with Serializable
The root of ErgoScript IR.
The root of ErgoScript IR. Serialized instances of this class are self sufficient and can be passed around. ErgoTreeSerializer defines top-level serialization format of the scripts. The interpretation of the byte array depend on the first
header
byte, which uses VLQ encoding up to 30 bits. Currently we define meaning for only first byte, which may be extended in future versions. 7 6 5 4 3 2 1 0 -------------------------Bit 7 == 1 if the header contains more than 1 byte (default == 0) Bit 6 - reserved for GZIP compression (should be 0) Bit 5 == 1 - reserved for context dependent costing (should be = 0) Bit 4 == 1 if constant segregation is used for this ErgoTree (default = 0) (see https://github.com/ScorexFoundation/sigmastate-interpreter/issues/264) Bit 3 == 1 if size of the whole tree is serialized after the header byte (default = 0) Bits 2-0 - language version (current version == 0)
Currently we don't specify interpretation for the second and other bytes of the header. We reserve the possibility to extend header by using Bit 7 == 1 and chain additional bytes as in VLQ. Once the new bytes are required, a new version of the language should be created and implemented. That new language will give an interpretation for the new bytes.
Consistency between fields is ensured by private constructor and factory methods in
ErgoTree
object. For performance reasons, ErgoTreeSerializer can be configured to perform additional constant segregation. In such a case after deserialization there may be more constants segregated. This is done for example to support caching optimization described in #264 mentioned above.The default behavior of ErgoTreeSerializer is to preserve original structure of ErgoTree and check consistency. In case of any inconsistency the serializer throws exception.
- trait EvaluatedCollection[T <: SType, C <: SCollection[T]] extends EvaluatedValue[C]
Base type for evaluated tree nodes of Coll type.
- abstract class EvaluatedValue[+S <: SType] extends Value[S]
Base class for ErgoTree nodes which represents a data value which has already been evaluated and no further evaluation (aka reduction) is necessary by the interpreter.
Base class for ErgoTree nodes which represents a data value which has already been evaluated and no further evaluation (aka reduction) is necessary by the interpreter.
- See also
Constant, ConcreteCollection, Tuple
- case class Exists[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SBoolean.type] with BooleanTransformer[IV] with Product with Serializable
Tests whether a predicate holds for at least one element of this collection.
Tests whether a predicate holds for at least one element of this collection.
- input
the collection to be tested
- condition
the predicate used to test elements.
- returns
true
if the givencondition
is satisfied by at least one element of this collection, otherwisefalse
- case class Exponentiate(left: Value[SGroupElement.type], right: Value[SBigInt.type]) extends Value[SGroupElement.type] with TwoArgumentsOperation[SGroupElement.type, SBigInt.type, SGroupElement.type] with NotReadyValueGroupElement with Product with Serializable
- sealed trait Extract[V <: SType] extends Value[V] with Transformer[SBox.type, V]
- case class ExtractAmount(input: Value[SBox.type]) extends Value[SLong.type] with Extract[SLong.type] with NotReadyValueLong with Product with Serializable
Extracts the monetary value, in Ergo tokens (NanoErg unit of measure) from input Box.
- case class ExtractBytes(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts serialized bytes of this box's content, including proposition bytes.
- case class ExtractBytesWithNoRef(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts serialized bytes of this box's content, excluding transactionId and index of output.
- case class ExtractCreationInfo(input: Value[SBox.type]) extends Value[STuple] with Extract[STuple] with NotReadyValue[STuple] with Product with Serializable
Tuple of height when block got included into the blockchain and transaction identifier with box index in the transaction outputs serialized to the byte array.
Tuple of height when block got included into the blockchain and transaction identifier with box index in the transaction outputs serialized to the byte array.
- input
box
- case class ExtractId(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts Blake2b256 hash of this box's content, basically equals to
blake2b256(bytes)
- case class ExtractRegisterAs[V <: SType](input: Value[SBox.type], registerId: RegisterId, tpe: SOption[V]) extends Value[SOption[V]] with Extract[SOption[V]] with NotReadyValue[SOption[V]] with Product with Serializable
See Box.getReg()
- case class ExtractScriptBytes(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extract serialized bytes of guarding script.
Extract serialized bytes of guarding script. As a reminder, the script should be evaluated to true in order to open this box. (aka spend it in a transaction).
- case class Filter[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Selects all elements of
input
collection which satisfy the condition.Selects all elements of
input
collection which satisfy the condition.- input
the collection to be filtered
- condition
the predicate used to test elements.
- returns
a new collection consisting of all elements of this collection that satisfy the given
condition
. The order of the elements is preserved.
- case class FixedCost(cost: JitCost) extends CostKind with Product with Serializable
Descriptor of the simple fixed cost.
Descriptor of the simple fixed cost.
- cost
given cost of the operation
- case class FixedCostItem(opDesc: OperationDesc, costKind: FixedCost) extends CostItem with Product with Serializable
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation.
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation. Represents cost of simple operation. Used for debugging, testing and profiling of costing.
- opDesc
descriptor of the ErgoTree operation
- costKind
kind of the cost to be added to accumulator
- trait FixedCostValueCompanion extends ValueCompanion
Should be inherited by companion objects of operations with fixed cost kind.
- case class Fold[IV <: SType, OV <: SType](input: Value[SCollection[IV]], zero: Value[OV], foldOp: Value[SFunc]) extends Value[OV] with Transformer[SCollection[IV], OV] with Product with Serializable
Applies a binary function to a start value and all elements of this collection, going left to right.
Applies a binary function to a start value and all elements of this collection, going left to right.
- OV
the result type of the binary operator.
- input
the collection to iterate
- zero
the start value.
- foldOp
the binary function.
- returns
the result of inserting
foldOp
between consecutive elements of this collection, going left to right with the start valuezero
on the left:foldOp(...foldOp(zero, x_1), x_2, ..., x_n)
where
x_1, ..., x_n
are the elements of this collection. Returnszero
if this collection is empty.
- case class ForAll[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SBoolean.type] with BooleanTransformer[IV] with Product with Serializable
Tests whether a predicate holds for all elements of this collection.
Tests whether a predicate holds for all elements of this collection.
- input
the collection to be tested
- condition
the predicate used to test elements.
- returns
true
if this collection is empty or the givencondition
holds for all elements of this collection, otherwisefalse
.
- case class FuncValue(args: IndexedSeq[(Int, SType)], body: Value[SType]) extends Value[SFunc] with NotReadyValue[SFunc] with Product with Serializable
- args
parameters list, where each parameter has an id and a type.
- body
expression, which refers function parameters with ValUse.
- case class GE[T <: SType](left: Value[T], right: Value[T]) extends Value[SBoolean.type] with SimpleRelation[T] with Product with Serializable
Greater or equals operation for SInt
- case class GT[T <: SType](left: Value[T], right: Value[T]) extends Value[SBoolean.type] with SimpleRelation[T] with Product with Serializable
Greater operation for SNumericType values
- case class GetVar[V <: SType](varId: Byte, tpe: SOption[V]) extends Value[SOption[V]] with NotReadyValue[SOption[V]] with Product with Serializable
See sigma.Context.getVar() for detailed description.
- case class Ident(name: String, tpe: SType = NoType) extends Value[SType] with Product with Serializable
Frontend node to represent variable names parsed in a source code.
Frontend node to represent variable names parsed in a source code. Should be resolved during compilation to lambda argument, Val definition or compilation environment value.
- case class If[T <: SType](condition: Value[SBoolean.type], trueBranch: Value[T], falseBranch: Value[T]) extends Value[T] with Quadruple[SBoolean.type, T, T, T] with Product with Serializable
If conditional function.
If conditional function. Non-lazy - evaluate both branches.
- condition
- condition to check
- trueBranch
- branch that will be used if condition is true
- falseBranch
- branch that will be used if condition is false
- final case class JitCost extends AnyVal with Product with Serializable
Represents cost estimation computed by JITC interpreter.
Represents cost estimation computed by JITC interpreter. The JITC costs use 10x more accurate scale comparing to block cost values.
- See also
toBlockCost
- case class LE[T <: SType](left: Value[T], right: Value[T]) extends Value[SBoolean.type] with SimpleRelation[T] with Product with Serializable
Less or equals operation for SInt
- case class LT[T <: SType](left: Value[T], right: Value[T]) extends Value[SBoolean.type] with SimpleRelation[T] with Product with Serializable
Less operation for SInt
- case class Lambda(tpeParams: Seq[STypeParam], args: IndexedSeq[(String, SType)], givenResType: SType, body: Option[Value[SType]]) extends Value[SFunc] with Product with Serializable
Frontend implementation of lambdas.
Frontend implementation of lambdas. Should be transformed to FuncValue.
- trait LazyCollection[V <: SType] extends Value[SCollection[V]] with NotReadyValue[SCollection[V]]
- case class LogicalNot(input: Value[SBoolean.type]) extends Value[SBoolean.type] with NotReadyValueBoolean with Product with Serializable
- trait LogicalTransformerCompanion extends ValueCompanion
Base trait for companions of OR, AND and XorOf nodes.
- case class LongToByteArray(input: Value[SLong.type]) extends Value[SByteArray] with Transformer[SLong.type, SByteArray] with NotReadyValueByteArray with Product with Serializable
Convert SLong to SByteArray
- case class MapCollection[IV <: SType, OV <: SType](input: Value[SCollection[IV]], mapper: Value[SFunc]) extends Value[SCollection[OV]] with Transformer[SCollection[IV], SCollection[OV]] with Product with Serializable
Builds a new collection by applying a function to all elements of this collection.
Builds a new collection by applying a function to all elements of this collection.
- IV
the element type of the input collection.
- OV
the element type of the returned collection.
- input
the collection to be mapped
- mapper
the function to apply to each element.
- returns
a new collection of type
Coll[OV]
resulting from applying the given functionmapper
to each element of this collection and collecting the results.
- trait MethodByNameUnapply extends MethodsContainer
Defines recognizer method which allows the derived object to be used in patterns to recognize method descriptors by method name.
Defines recognizer method which allows the derived object to be used in patterns to recognize method descriptors by method name.
- See also
SCollecton
- case class MethodCall(obj: Value[SType], method: SMethod, args: IndexedSeq[Value[SType]], typeSubst: Map[STypeVar, SType]) extends Value[SType] with Product with Serializable
Represents in ErgoTree an invocation of method of the object
obj
with argumentsargs
.Represents in ErgoTree an invocation of method of the object
obj
with argumentsargs
. The SMethod instances in STypeCompanions may have type STypeIdent in methods types, but valid ErgoTree should have SMethod instances specialized for specific types of obj and args usingspecializeFor
. This means, if we save typeId, methodId, and we save all the arguments, we can restore the specialized SMethod instance. This work by induction, if we assume all arguments are monomorphic, then we can make MethodCall monomorphic. Thus, all ErgoTree instances are monomorphic by construction.- obj
object on which method will be invoked
- method
method to be invoked
- args
arguments passed to the method on invocation
- typeSubst
a map of concrete type for each generic type parameter
- case class MethodCallLike(obj: Value[SType], name: String, args: IndexedSeq[Value[SType]], tpe: SType = NoType) extends Value[SType] with Product with Serializable
Frontend node to represent potential method call in a source code.
Frontend node to represent potential method call in a source code. Should be resolved during compilation to MethodCall. Cannot be serialized to ErgoTree.
- case class MethodDesc(method: SMethod) extends OperationDesc with Product with Serializable
Operation descriptor based on SMethod.
- case class MethodIRInfo(irBuilder: Option[PartialFunction[(SigmaBuilder, SValue, SMethod, Seq[SValue], STypeSubst), SValue]], javaMethod: Option[RMethod], invokeDescsBuilder: Option[InvokeDescBuilder]) extends Product with Serializable
Meta information connecting SMethod with ErgoTree.
Meta information connecting SMethod with ErgoTree. The optional builder is used by front-end ErgoScript compiler to replace method calls with ErgoTree nodes. In many cases SMethod.MethodCallIrBuilder builder is used. However there are specific cases where more complex builders are used, see for example usage of
withIRInfo
in the declaration of SCollection.GetOrElseMethod.- irBuilder
optional method call recognizer and ErgoTree node builder. When the partial function is defined on a tuple (builder, obj, m, args, subst) it transforms it to a new ErgoTree node, which is then used in the resuting ErgoTree coming out of the ErgoScript compiler.
- javaMethod
Java Method which should be used to evaluate sigmastate.lang.Terms.MethodCall node of ErgoTree.
- invokeDescsBuilder
optional builder of additional type descriptors (see extraDescriptors)
- sealed trait MethodsContainer extends AnyRef
Base trait for all method containers (which store methods and properties)
- case class ModQ(input: Value[SBigInt.type]) extends Value[SBigInt.type] with NotReadyValue[SBigInt.type] with Product with Serializable
- case class ModQArithOp(left: Value[SBigInt.type], right: Value[SBigInt.type], opCode: OpCode) extends Value[SBigInt.type] with NotReadyValue[SBigInt.type] with Product with Serializable
- abstract class ModQArithOpCompanion extends ValueCompanion
- trait MonoTypeMethods extends MethodsContainer
- case class MultiplyGroup(left: Value[SGroupElement.type], right: Value[SGroupElement.type]) extends Value[SGroupElement.type] with TwoArgumentsOperation[SGroupElement.type, SGroupElement.type, SGroupElement.type] with NotReadyValueGroupElement with Product with Serializable
- case class NEQ[S <: SType](left: Value[S], right: Value[S]) extends Value[SBoolean.type] with SimpleRelation[S] with Product with Serializable
Non-Equals operation for SType
- case class NamedDesc(operationName: String) extends OperationDesc with Product with Serializable
Operation descriptor based on name.
- case class Negation[T <: SType](input: Value[T]) extends Value[T] with OneArgumentOperation[T, T] with Product with Serializable
Negation operation on numeric type T.
Negation operation on numeric type T. See ExactNumeric instance for the corresponding type T.
- trait NotReadyValue[S <: SType] extends Value[S]
- trait NotReadyValueAvlTree extends Value[SAvlTree.type] with NotReadyValue[SAvlTree.type]
- trait NotReadyValueBigInt extends Value[SBigInt.type] with NotReadyValue[SBigInt.type]
- trait NotReadyValueBoolean extends Value[SBoolean.type] with NotReadyValue[SBoolean.type]
- trait NotReadyValueBox extends Value[SBox.type] with NotReadyValue[SBox.type]
- trait NotReadyValueByteArray extends Value[SByteArray] with NotReadyValue[SByteArray]
- trait NotReadyValueGroupElement extends Value[SGroupElement.type] with NotReadyValue[SGroupElement.type]
- trait NotReadyValueInt extends Value[SInt.type] with NotReadyValue[SInt.type]
- trait NotReadyValueLong extends Value[SLong.type] with NotReadyValue[SLong.type]
- trait NumericCastCompanion extends ValueCompanion
Base class for Upcast and Downcast companion objects.
- case class OR(input: Value[SCollection[SBoolean.type]]) extends Value[SBoolean.type] with Transformer[SCollection[SBoolean.type], SBoolean.type] with NotReadyValueBoolean with Product with Serializable
OR logical conjunction
- sealed trait OneArgumentOperation[IV <: SType, OV <: SType] extends Value[OV] with NotReadyValue[OV]
- trait OneArgumentOperationCompanion extends ValueCompanion
- trait OpGroup[C <: ValueCompanion] extends AnyRef
- case class OperationCostInfo[C <: CostKind](costKind: C, opDesc: OperationDesc) extends Product with Serializable
Operation costing descriptors combined together.
- abstract class OperationDesc extends AnyRef
Each costable operation is described in one of the following ways: 1) using ValueCompanion - operation with separate node class 2) using SMethod - operation represented as method.
Each costable operation is described in one of the following ways: 1) using ValueCompanion - operation with separate node class 2) using SMethod - operation represented as method. 3) using string name - intermediate sub-operation present in cost model, but which is not a separate operation of ErgoTree.
- case class OperationInfo(opDesc: Option[ValueCompanion], description: String, args: Seq[ArgInfo]) extends Product with Serializable
Meta information which can be attached to SMethod.
Meta information which can be attached to SMethod.
- opDesc
optional operation descriptor
- description
human readable description of the method
- args
one item for each argument
- case class OptionGet[V <: SType](input: Value[SOption[V]]) extends Value[V] with Transformer[SOption[V], V] with Product with Serializable
Returns the option's value.
Returns the option's value.
- Exceptions thrown
java.util.NoSuchElementException
if the option is empty.- Note
The option must be nonempty.
- case class OptionGetOrElse[V <: SType](input: Value[SOption[V]], default: Value[V]) extends Value[V] with Transformer[SOption[V], V] with Product with Serializable
Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default
.Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default
. NOTE: thedefault
is evaluated even if the option contains the value i.e. not lazily.- default
the default expression.
- case class OptionIsDefined[V <: SType](input: Value[SOption[V]]) extends Value[SBoolean.type] with Transformer[SOption[V], SBoolean.type] with Product with Serializable
Returns false if the option is None, true otherwise.
- case class PerItemCost(baseCost: JitCost, perChunkCost: JitCost, chunkSize: Int) extends CostKind with Product with Serializable
Cost of operation over collection of the known length.
Cost of operation over collection of the known length. See for example Exists, MapCollection.
- baseCost
cost of operation factored out of the loop iterations
- perChunkCost
cost associated with each chunk of items
- chunkSize
number of items in a chunk
- trait PerItemCostValueCompanion extends ValueCompanion
Should be inherited by companion objects of operations with per-item cost kind.
- sealed trait Quadruple[IV1 <: SType, IV2 <: SType, IV3 <: SType, OV <: SType] extends Value[OV] with NotReadyValue[OV]
A tree node with three descendants
- trait QuadrupleCompanion extends ValueCompanion
- sealed trait Relation[LIV <: SType, RIV <: SType] extends Value[SBoolean.type] with Triple[LIV, RIV, SBoolean.type] with NotReadyValueBoolean
- trait RelationCompanion extends ValueCompanion
- trait SCollection[T <: SType] extends SProduct with SGenericType
Base class for descriptors of
Coll[T]
ErgoTree type for some elemType T. - case class SCollectionType[T <: SType](elemType: T) extends SCollection[T] with Product with Serializable
Descriptor of
Coll[T]
ErgoTree type for some elemType T. - trait SEmbeddable extends SType
Base trait for all embeddable types.
- case class SFunc(tDom: IndexedSeq[SType], tRange: SType, tpeParams: Seq[STypeParam] = Nil) extends SType with SGenericType with Product with Serializable
Type descriptor of lambda types.
- trait SGenericType extends AnyRef
Base trait implemented by all generic types (those which has type parameters, e.g.
Base trait implemented by all generic types (those which has type parameters, e.g. Coll[T], Option[T], etc.)
- trait SLogical extends SType
Base type for SBoolean and SSigmaProp.
- case class SMethod(objType: MethodsContainer, name: String, stype: SFunc, methodId: Byte, costKind: CostKind, irInfo: MethodIRInfo, docInfo: Option[OperationInfo], costFunc: Option[MethodCostFunc]) extends Product with Serializable
Represents method descriptor.
Represents method descriptor.
- objType
type or type constructor descriptor
- name
method name
- stype
method signature type, where
stype.tDom
- argument type and
stype.tRange- method result type.
- methodId
method code, it should be unique among methods of the same objType.
- costKind
cost descriptor for this method
- irInfo
meta information connecting SMethod with ErgoTree (see MethodIRInfo)
- docInfo
optional human readable method description data
- costFunc
optional specification of how the cost should be computed for the given method call (See ErgoTreeEvaluator.calcCost method).
- trait SMonoType extends SType with STypeCompanion
Monomorphic type descriptor i.e.
Monomorphic type descriptor i.e. a type without generic parameters.
- See also
SGenericType
- trait SNumericType extends SProduct with STypeCompanion
Marker trait for all numeric types.
- trait SNumericTypeMethods extends MonoTypeMethods
- case class SOption[ElemType <: SType](elemType: ElemType) extends SProduct with SGenericType with Product with Serializable
Type description of optional values.
Type description of optional values. Instances of
Option
are either constructed bySome
or byNone
constructors. - trait SPredefType extends SType
Base trait for all pre-defined types which are not necessary primitive (e.g.
Base trait for all pre-defined types which are not necessary primitive (e.g. Box, AvlTree).
- trait SPrimType extends SType with SPredefType
Base trait for all primitive types (aka atoms) which don't have internal type items.
Base trait for all primitive types (aka atoms) which don't have internal type items. All primitive types can occupy a reserved interval of codes from 1 to MaxPrimTypeCode.
- trait SProduct extends SType
Base trait for all types which have methods (and properties)
- case class STuple(items: IndexedSeq[SType]) extends SCollection[SAny.type] with Product with Serializable
Type descriptor of tuple type.
- sealed trait SType extends SigmaNode
Every type descriptor is a tree represented by nodes in SType hierarchy.
Every type descriptor is a tree represented by nodes in SType hierarchy. In order to extend type family: - Implement concrete class derived from SType - Implement serializer (see SCollectionSerializer) and register it in STypeSerializer.table Each SType is serialized to array of bytes by: - emitting typeCode of each node (see special case for collections below) - then recursively serializing subtrees from left to right on each level - for each collection of primitive type there is special type code to emit single byte instead of two bytes Types code intervals - (1 .. MaxPrimTypeCode) // primitive types - (CollectionTypeCode .. CollectionTypeCode + MaxPrimTypeCode) // collections of primitive types - (MaxCollectionTypeCode ..) // Other types Collection of non-primitive type is serialized as (CollectionTypeCode, serialize(elementType))
- case class STypeApply(name: String, args: IndexedSeq[SType] = IndexedSeq()) extends SType with Product with Serializable
Used by ErgoScript compiler IR and eliminated during compilation.
Used by ErgoScript compiler IR and eliminated during compilation. It is not used in ErgoTree.
- trait STypeCompanion extends AnyRef
Basic interface for all type companions.
Basic interface for all type companions. This is necessary to make distinction between concrete type descriptor of a type like Coll[Int] and generic descriptor of Coll[T] type constructor. Some simple types like Int, GroupElement inherit from both SType and STypeCompanion.
- See also
SInt, SGroupElement, SType
- implicit final class STypeOps extends AnyVal
- case class STypeParam(ident: STypeVar, upperBound: Option[SType] = None, lowerBound: Option[SType] = None) extends Product with Serializable
Represents a type parameter in a type system.
Represents a type parameter in a type system.
- ident
The identifier for this type parameter.
- upperBound
The upper bound of this type parameter, if exists.
- lowerBound
The lower bound of this type parameter, if exists.
- Note
Type parameters with bounds are currently not supported.
- type STypeSubst = Map[STypeVar, SType]
Type alias for a substitution of type variables with their corresponding types.
- case class STypeVar(name: String) extends SType with Product with Serializable
Type variable which is used in generic method/func signatures.
Type variable which is used in generic method/func signatures. Used by ErgoScript compiler IR and eliminated during compilation. It is not used in ErgoTree.
- case class Select(obj: Value[SType], field: String, resType: Option[SType] = None) extends Value[SType] with Product with Serializable
Frontend node to select a field from an object.
Frontend node to select a field from an object. Should be transformed to SelectField
- case class SelectField(input: Value[STuple], fieldIndex: Byte) extends Value[SType] with Transformer[STuple, SType] with NotReadyValue[SType] with Product with Serializable
Select tuple field by its 1-based index.
Select tuple field by its 1-based index. E.g. input._1 is transformed to SelectField(input, 1)
- case class SeqCostItem(opDesc: OperationDesc, costKind: PerItemCost, nItems: Int) extends CostItem with Product with Serializable
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation.
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation. Represents cost of a sequence of operation. Used for debugging, testing and profiling of costing.
- opDesc
descriptor of the ErgoTree operation
- costKind
descriptor of the cost added to accumulator
- nItems
number of items in the sequence
- case class SigmaAnd(items: Seq[SigmaPropValue]) extends SigmaPropValue with SigmaTransformer[SigmaPropValue, SigmaPropValue] with Product with Serializable
AND conjunction for sigma propositions
- abstract class SigmaBuilder extends AnyRef
Abstract interface of ErgoTree node builders.
Abstract interface of ErgoTree node builders. Each method of the interface creates the corresponding ErgoTree node. The signatures of the methods reflect the constructors of the nodes. See the corresponding node classes for details.
- trait SigmaNode extends Product
Base type for all AST nodes of ErgoTree.
- trait SigmaNodeCompanion extends AnyRef
Base type for all companions of AST nodes of sigma lang.
- case class SigmaOr(items: Seq[SigmaPropValue]) extends SigmaPropValue with SigmaTransformer[SigmaPropValue, SigmaPropValue] with Product with Serializable
OR disjunction for sigma propositions
- case class SigmaPropBytes(input: Value[SSigmaProp.type]) extends Value[SByteArray] with Transformer[SSigmaProp.type, SByteArray] with NotReadyValue[SByteArray] with Product with Serializable
Extract serialized bytes of a SigmaProp value
- case class SigmaPropIsProven(input: Value[SSigmaProp.type]) extends Value[SBoolean.type] with Transformer[SSigmaProp.type, SBoolean.type] with NotReadyValueBoolean with Product with Serializable
Represents execution of Sigma protocol that validates the given input SigmaProp.
- trait SigmaTransformer[IV <: SigmaPropValue, OV <: SigmaPropValue] extends SigmaPropValue
- trait SigmaTransformerCompanion extends ValueCompanion
- trait SimpleRelation[T <: SType] extends Value[SBoolean.type] with Relation[T, T]
- trait SimpleTransformerCompanion extends ValueCompanion
- case class SizeOf[V <: SType](input: Value[SCollection[V]]) extends Value[SInt.type] with Transformer[SCollection[V], SInt.type] with NotReadyValueInt with Product with Serializable
The length of the collection (aka size).
- case class Slice[IV <: SType](input: Value[SCollection[IV]], from: Value[SInt.type], until: Value[SInt.type]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Selects an interval of elements.
Selects an interval of elements. The returned collection is made up of all elements
x
which satisfy the invariant:from <= indexOf(x) < until
- from
the lowest index to include from this collection.
- until
the lowest index to EXCLUDE from this collection.
- case class SourceContext(line: Int, column: Int, sourceLine: String) extends Product with Serializable
- class StdSigmaBuilder extends SigmaBuilder
Standard implementation of SigmaBuilder interface in which most of the operations delegate common logic to equalityOp, comparisonOp and arithOp with default implementation.
Standard implementation of SigmaBuilder interface in which most of the operations delegate common logic to equalityOp, comparisonOp and arithOp with default implementation. Note, each method of this class uses current value of
currentSrcCtx
dynamic variable to attach SourceContext to the created node. Thus, it is a responsibility of the caller to provide valid value of thecurrentSrcCtx
variable. (See for example how this variable is used in SigmaParser.) - case class SubstConstants[T <: SType](scriptBytes: Value[SByteArray], positions: Value[SIntArray], newValues: Value[SCollection[T]]) extends Value[SByteArray] with NotReadyValueByteArray with Product with Serializable
Transforms serialized bytes of ErgoTree with segregated constants by replacing constants at given positions with new values.
Transforms serialized bytes of ErgoTree with segregated constants by replacing constants at given positions with new values. This operation allow to use serialized scripts as pre-defined templates. The typical usage is "check that output box have proposition equal to given script bytes, where minerPk (constants(0)) is replaced with currentMinerPk". Each constant in original scriptBytes have SType serialized before actual data (see ConstantSerializer). During substitution each value from newValues is checked to be an instance of the corresponding type. This means, the constants during substitution cannot change their types.
- scriptBytes
serialized ErgoTree with ConstantSegregationFlag set to 1.
- positions
zero based indexes in ErgoTree.constants array which should be replaced with new values
- newValues
new values to be injected into the corresponding positions in ErgoTree.constants array
- returns
original scriptBytes array where only specified constants are replaced and all other bytes remain exactly the same
- trait TaggedVariable[T <: SType] extends Value[T] with NotReadyValue[T]
Reference a context variable by id.
- case class TaggedVariableNode[T <: SType](varId: Byte, tpe: T) extends Value[T] with TaggedVariable[T] with Product with Serializable
- trait Transformer[IV <: SType, OV <: SType] extends Value[OV] with NotReadyValue[OV]
Every operation is a transformer of some kind.
Every operation is a transformer of some kind. This trait is used merely to simplify implementation and avoid copy-paste.
- class TransformingSigmaBuilder extends StdSigmaBuilder
Builder which does automatic upcast of numeric arguments when necessary.
Builder which does automatic upcast of numeric arguments when necessary. The upcast is implemented by inserting additional Upcast nodes. It also performs checking of constrains.
- case class TreeLookup(tree: Value[SAvlTree.type], key: Value[SByteArray], proof: Value[SByteArray]) extends Value[SOption[SByteArray]] with Quadruple[SAvlTree.type, SByteArray, SByteArray, SOption[SByteArray]] with Product with Serializable
Perform a lookup of key
key
in a tree with roottree
using proofproof
.Perform a lookup of key
key
in a tree with roottree
using proofproof
. Throws exception if proof is incorrect Return Some(bytes) of leaf with keykey
if it exists Return None if leaf with provided key does not exist. - sealed trait Triple[LIV <: SType, RIV <: SType, OV <: SType] extends Value[OV] with NotReadyValue[OV]
A tree node with left and right descendants
- case class Tuple(items: IndexedSeq[Value[SType]]) extends EvaluatedValue[STuple] with EvaluatedCollection[SAny.type, STuple] with Product with Serializable
ErgoTree node which converts a collection of expressions into a tuple of data values of different types.
ErgoTree node which converts a collection of expressions into a tuple of data values of different types. Each data value of the resulting collection is obtained by evaluating the corresponding expression in
items
. All items may have different types.- items
source collection of expressions
- trait TwoArgumentOperationCompanion extends ValueCompanion
- sealed trait TwoArgumentsOperation[LIV <: SType, RIV <: SType, OV <: SType] extends Value[OV] with Triple[LIV, RIV, OV]
- abstract class TypeBasedCost extends CostKind
Descriptor of the cost which depends on type.
- case class TypeBasedCostItem(opDesc: OperationDesc, costKind: TypeBasedCost, tpe: SType) extends CostItem with Product with Serializable
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation.
An item in the cost accumulation trace of a sigma.ast.ErgoTree evaluation. Represents cost of an operation which depends on type (e.g. type of arguments). Used for debugging, testing and profiling of costing.
- opDesc
descriptor of the ErgoTree operation
- costKind
type based cost descriptor added to accumulator
- tpe
concrete type on this the operation is executed
- case class UnparsedErgoTree(bytes: WrappedArray[Byte], error: ValidationException) extends Product with Serializable
This is alternative representation of ErgoTree expression when it cannot be parsed due to
error
.This is alternative representation of ErgoTree expression when it cannot be parsed due to
error
. This is used by the nodes running old versions of code to recognize soft-fork conditions and skip validation of box propositions which are unparsable. - case class Upcast[T <: SNumericType, R <: SNumericType](input: Value[T], tpe: R) extends Value[R] with Transformer[T, R] with Product with Serializable
Up cast for Numeric types
- trait Val extends Value[SType]
- case class ValDef(id: Int, tpeArgs: Seq[STypeVar], rhs: SValue) extends Value[SType] with BlockItem with Product with Serializable
IR node for let-bound expressions
let x = rhs
which is ValDef, orlet f[T] = rhs
which is FunDef.IR node for let-bound expressions
let x = rhs
which is ValDef, orlet f[T] = rhs
which is FunDef. These nodes are used to represent ErgoTrees after common sub-expression elimination. This representation is more compact in serialized form.- id
unique identifier of the variable in the current scope.
- case class ValNode(name: String, givenType: SType, body: SValue) extends Value[SType] with Val with Product with Serializable
- case class ValUse[T <: SType](valId: Int, tpe: T) extends Value[T] with NotReadyValue[T] with Product with Serializable
Special node which represents a reference to ValDef it was introduced as result of CSE.
- abstract class Value[+S <: SType] extends SigmaNode
Base class for all ErgoTree expression nodes.
Base class for all ErgoTree expression nodes.
- See also
- trait ValueCompanion extends SigmaNodeCompanion
Base class for all companion objects which are used as operation descriptors.
- case class Xor(left: Value[SByteArray], right: Value[SByteArray]) extends Value[SByteArray] with TwoArgumentsOperation[SByteArray, SByteArray, SByteArray] with NotReadyValueByteArray with Product with Serializable
XOR for two SByteArray
- case class XorOf(input: Value[SCollection[SBoolean.type]]) extends Value[SBoolean.type] with Transformer[SCollection[SBoolean.type], SBoolean.type] with NotReadyValueBoolean with Product with Serializable
Similar to allOf, but performing logical XOR operation instead of
&&
- case class ZKProofBlock(body: SigmaPropValue) extends BoolValue with Product with Serializable
IR node to represent explicit Zero Knowledge scope in ErgoTree.
IR node to represent explicit Zero Knowledge scope in ErgoTree. Compiler checks Zero Knowledge properties and issue error message is case of violations. ZK-scoping is optional, it can be used when the user want to ensure Zero Knowledge of specific set of operations. Usually it will require simple restructuring of the code to make the scope body explicit. Invariants checked by the compiler:
- single ZKProof in ErgoTree in a root position
- no boolean operations in the body, because otherwise the result may be disclosed
- all the operations are over SigmaProp values
For motivation and details see https://github.com/ScorexFoundation/sigmastate-interpreter/issues/236
Value Members
- val EmptySubst: Map[STypeVar, SType]
Immutable and sharable empty substitution.
- def applySubst(tpe: SType, subst: STypeSubst): SType
Applies a type substitution to a given type.
Applies a type substitution to a given type.
- tpe
the type to apply the substitution to
- subst
the type substitution to apply
- returns
the type after applying the substitution
- def msgType(t1: SType, t2: SType): Option[SType]
Computes the most general type given two types.
Computes the most general type given two types.
- t1
the first type
- t2
the second type
- returns
the most general type if it exists, otherwise None
- def msgTypeOf(ts: Seq[SType]): Option[SType]
Most Specific Generalized (MSG) type of ts.
Most Specific Generalized (MSG) type of ts. Currently just the type of the first element as long as all the elements have the same type.
- def unifyTypeLists(items1: Seq[SType], items2: Seq[SType]): Option[STypeSubst]
Performs pairwise type unification making sure each type variable is equally substituted in all items.
- def unifyTypes(t1: SType, t2: SType): Option[STypeSubst]
Finds a substitution
subst
of type variables such that unifyTypes(applySubst(t1, subst), t2) shouldBe Some(emptySubst) - object AND extends LogicalTransformerCompanion with Serializable
- object Append extends ValueCompanion with Serializable
- object Apply extends FixedCostValueCompanion with Serializable
- object ApplyTypes extends ValueCompanion with Serializable
- object ArithOp extends Serializable
- object AtLeast extends ValueCompanion with Serializable
- object AvlTreeConstant
- object BigIntArrayConstant
- object BigIntConstant
- object BinAnd extends RelationCompanion with FixedCostValueCompanion with Serializable
- object BinOr extends RelationCompanion with FixedCostValueCompanion with Serializable
- object BinXor extends RelationCompanion with FixedCostValueCompanion with Serializable
- object BitInversion extends OneArgumentOperationCompanion with Serializable
- object BitOp extends Serializable
- object Block extends ValueCompanion with Serializable
- object BlockItem
- object BlockValue extends ValueCompanion with Serializable
- object BoolArrayConstant
- object BoolToSigmaProp extends FixedCostValueCompanion with Serializable
- object BooleanConstant
- object BoxConstant
- object ByIndex extends FixedCostValueCompanion with Serializable
- object ByteArrayConstant
- object ByteArrayToBigInt extends SimpleTransformerCompanion with Serializable
- object ByteArrayToLong extends SimpleTransformerCompanion with Serializable
- object ByteConstant
- object CalcBlake2b256 extends SimpleTransformerCompanion with Serializable
- object CalcHash
- object CalcSha256 extends SimpleTransformerCompanion with Serializable
- case object CheckingSigmaBuilder extends CheckingSigmaBuilder with Product with Serializable
Builder which performs checking of constraints on numeric operations.
- object CollectionConstant
- object ConcreteCollection extends FixedCostValueCompanion with Serializable
- object ConcreteCollectionBooleanConstant extends ValueCompanion
- object Constant extends FixedCostValueCompanion
- object ConstantPlaceholder extends ValueCompanion with Serializable
- object Constraints
- case object Context extends Value[SContext.type] with NotReadyValue[SContext.type] with ValueCompanion with Product with Serializable
When interpreted evaluates to the singleton instance of sigma.Context.
When interpreted evaluates to the singleton instance of sigma.Context. Corresponds to
CONTEXT
variable in ErgoScript which can be used likeCONTEXT.headers
. - object CreateAvlTree extends ValueCompanion with Serializable
- object CreateProveDHTuple extends FixedCostValueCompanion with Serializable
- object CreateProveDlog extends FixedCostValueCompanion with Serializable
- object DecodePoint extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- case object DeserializationSigmaBuilder extends TransformingSigmaBuilder with Product with Serializable
Builder of ErgoTree nodes which is used in deserializers.
- object DeserializeContext extends ValueCompanion with Serializable
- object DeserializeRegister extends ValueCompanion with Serializable
- object Downcast extends NumericCastCompanion with Serializable
- case object DynamicCost extends CostKind with Product with Serializable
Cost of operation cannot be described using fixed set of parameters.
- object EQ extends RelationCompanion with Serializable
- object ErgoTree extends Serializable
- object Exists extends BooleanTransformerCompanion with Serializable
- object Exponentiate extends TwoArgumentOperationCompanion with FixedCostValueCompanion with Serializable
- object ExtractAmount extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object ExtractBytes extends SimpleTransformerCompanion with Serializable
- object ExtractBytesWithNoRef extends SimpleTransformerCompanion with Serializable
- object ExtractCreationInfo extends SimpleTransformerCompanion with Serializable
- object ExtractId extends SimpleTransformerCompanion with Serializable
- object ExtractRegisterAs extends FixedCostValueCompanion with Serializable
- object ExtractScriptBytes extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object FalseLeaf extends ConstantNode[SBoolean.type] with ValueCompanion
ErgoTree node which represents
false
literal. - object Filter extends ValueCompanion with Serializable
- object FixedCostItem extends Serializable
- object Fold extends ValueCompanion with Serializable
- object ForAll extends BooleanTransformerCompanion with Serializable
- object FunDef extends ValueCompanion
- object FuncValue extends FixedCostValueCompanion with Serializable
- object GE extends RelationCompanion with Serializable
- object GT extends RelationCompanion with Serializable
- object GetVar extends FixedCostValueCompanion with Serializable
- case object Global extends Value[SGlobal.type] with NotReadyValue[SGlobal.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to the singleton instance of sigma.SigmaDslBuilder.
When interpreted evaluates to the singleton instance of sigma.SigmaDslBuilder. Corresponds to
Global
variable in ErgoScript which can be used likeGlobal.groupGenerator
. - object GroupElementConstant
- case object GroupGenerator extends EvaluatedValue[SGroupElement.type] with ValueCompanion with Product with Serializable
ErgoTree node that represents the operation of obtaining the generator of elliptic curve group.
ErgoTree node that represents the operation of obtaining the generator of elliptic curve group. The generator g of the group is an element of the group such that, when written multiplicative form, every element of the group is a power of g.
- object HeaderConstant
- case object Height extends Value[SInt.type] with NotReadyValueInt with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a IntConstant built from Context.currentHeight
- object Ident extends ValueCompanion with Serializable
- object If extends QuadrupleCompanion with FixedCostValueCompanion with Serializable
- case object Inputs extends Value[SCollection[SBox.type]] with LazyCollection[SBox.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a collection of BoxConstant built from Context.boxesToSpend
- object IntArrayConstant
- object IntConstant
- object JitCost extends Serializable
- object LE extends RelationCompanion with Serializable
- object LT extends RelationCompanion with Serializable
- object Lambda extends ValueCompanion with Serializable
- case object LastBlockUtxoRootHash extends Value[SAvlTree.type] with NotReadyValueAvlTree with ValueCompanion with Product with Serializable
When interpreted evaluates to a AvlTreeConstant built from Context.lastBlockUtxoRoot
- object LogicalNot extends FixedCostValueCompanion with Serializable
- object LongArrayConstant
- object LongConstant
- object LongToByteArray extends SimpleTransformerCompanion with Serializable
- object MapCollection extends ValueCompanion with Serializable
- object MethodCall extends FixedCostValueCompanion with Serializable
- object MethodCallLike extends ValueCompanion with Serializable
- object MethodsContainer
- case object MinerPubkey extends Value[SByteArray] with NotReadyValueByteArray with ValueCompanion with Product with Serializable
When interpreted evaluates to a ByteArrayConstant built from Context.minerPubkey
- object ModQ extends ValueCompanion with Serializable
- object ModQArithOp extends OpGroup[ModQArithOpCompanion] with Serializable
- object MultiplyGroup extends TwoArgumentOperationCompanion with FixedCostValueCompanion with Serializable
- object NEQ extends RelationCompanion with Serializable
- object Negation extends OneArgumentOperationCompanion with FixedCostValueCompanion with Serializable
- case object NoType extends SType with Product with Serializable
Special type to represent untyped values.
Special type to represent untyped values. Interpreter raises an error when encounter a Value with this type. All Value nodes with this type should be elimitanted during typing. If no specific type can be assigned statically during typing, then either error should be raised or type SAny should be assigned which is interpreted as dynamic typing.
- object NumericCastCostKind extends TypeBasedCost
Cost of: 1) converting numeric value to the numeric value of the given type, i.e.
Cost of: 1) converting numeric value to the numeric value of the given type, i.e. Byte -> Int NOTE: the cost of BigInt casting is the same in JITC (comparing to AOTC) to simplify implementation.
- object OR extends LogicalTransformerCompanion with Serializable
- object OperationInfo extends Serializable
- object Operations
WARNING: This file is generated by GenInfoObjects tool.
WARNING: This file is generated by GenInfoObjects tool. Don't edit it directly, use the tool instead to regenerate. The operations are alphabetically sorted.
- object OptionGet extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object OptionGetOrElse extends ValueCompanion with FixedCostValueCompanion with Serializable
- object OptionIsDefined extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- case object Outputs extends Value[SCollection[SBox.type]] with LazyCollection[SBox.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a collection of BoxConstant built from Context.spendingTransaction.outputs
- object PreHeaderConstant
- object PropertyCall extends FixedCostValueCompanion
- case object SAny extends SPrimType with SMonoType with Product with Serializable
Any other type is implicitly subtype of this type.
- case object SAnyMethods extends MonoTypeMethods with Product with Serializable
Any other type is implicitly subtype of this type.
- case object SAvlTree extends SProduct with SPredefType with SMonoType with Product with Serializable
Type descriptor of
AvlTree
type of ErgoTree. - case object SAvlTreeMethods extends MonoTypeMethods with Product with Serializable
Type descriptor of
AvlTree
type of ErgoTree. - case object SBigInt extends SPrimType with SEmbeddable with SNumericType with SMonoType with Product with Serializable
Type of 256 bit integet values.
Type of 256 bit integet values. Implemented using java.math.BigInteger.
- case object SBigIntMethods extends SNumericTypeMethods with Product with Serializable
Methods of BigInt type.
Methods of BigInt type. Implemented using java.math.BigInteger.
- case object SBoolean extends SPrimType with SEmbeddable with SLogical with SProduct with SMonoType with Product with Serializable
Descriptor of ErgoTree type
Boolean
holdingtrue
orfalse
values. - case object SBooleanMethods extends MonoTypeMethods with Product with Serializable
Methods of ErgoTree type
Boolean
. - case object SBox extends SProduct with SPredefType with SMonoType with Product with Serializable
Type descriptor of
Box
type of ErgoTree. - case object SBoxMethods extends MonoTypeMethods with Product with Serializable
Type descriptor of
Box
type of ErgoTree. - case object SByte extends SPrimType with SEmbeddable with SNumericType with SMonoType with Product with Serializable
Descriptor of ErgoTree type
Byte
- 8-bit signed integer. - case object SByteMethods extends SNumericTypeMethods with Product with Serializable
Methods of ErgoTree type
Byte
. - object SCollection extends STypeCompanion
- object SCollectionMethods extends MethodsContainer with MethodByNameUnapply
- object SCollectionType extends Serializable
- case object SContext extends SProduct with SPredefType with SMonoType with Product with Serializable
Type descriptor of
Context
type of ErgoTree. - case object SContextMethods extends MonoTypeMethods with Product with Serializable
Type descriptor of
Context
type of ErgoTree. - object SFunc extends Serializable
- case object SGlobal extends SProduct with SPredefType with SMonoType with Product with Serializable
This type is introduced to unify handling of global and non-global (i.e.
This type is introduced to unify handling of global and non-global (i.e. methods) operations. It unifies implementation of global operation with implementation of methods and avoids code duplication (following DRY principle https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). The WrappedType is
sigma.SigmaDslBuilder
, which is an interface implemented by the singleton sigmastate.eval.CostingSigmaDslBuilderThe Constant(...) tree node of this type are not allowed, as well as using it in register and context variables (aka ContextExtension)
When new methods are added to this type via a soft-fork, they will be serialized as part of ErgoTree using MethodCallSerializer, where SGlobal.typeCode will be used.
- See also
sigmastate.lang.SigmaPredef
- case object SGlobalMethods extends MonoTypeMethods with Product with Serializable
This type is introduced to unify handling of global and non-global (i.e.
This type is introduced to unify handling of global and non-global (i.e. methods) operations. It unifies implementation of global operation with implementation of methods and avoids code duplication (following DRY principle https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). The WrappedType is
sigma.SigmaDslBuilder
, which is an interface implemented by the singleton sigmastate.eval.CostingSigmaDslBuilderThe Constant(...) tree node of this type are not allowed, as well as using it in register and context variables (aka ContextExtension)
When new methods are added to this type via a soft-fork, they will be serialized as part of ErgoTree using MethodCallSerializer, where SGlobal.typeCode will be used.
- See also
sigmastate.lang.SigmaPredef
- case object SGroupElement extends SProduct with SPrimType with SEmbeddable with SMonoType with Product with Serializable
Descriptor of ErgoTree type
GroupElement
.Descriptor of ErgoTree type
GroupElement
. NOTE: this descriptor both type and type companion - case object SGroupElementMethods extends MonoTypeMethods with Product with Serializable
Methods of type
GroupElement
. - case object SHeader extends SProduct with SPredefType with SMonoType with Product with Serializable
Type descriptor of
Header
type of ErgoTree. - case object SHeaderMethods extends MonoTypeMethods with Product with Serializable
Type descriptor of
Header
type of ErgoTree. - case object SInt extends SPrimType with SEmbeddable with SNumericType with SMonoType with Product with Serializable
Descriptor of ErgoTree type
Int
- 32-bit signed integer. - case object SIntMethods extends SNumericTypeMethods with Product with Serializable
Descriptor of ErgoTree type
Int
. - case object SLong extends SPrimType with SEmbeddable with SNumericType with SMonoType with Product with Serializable
Descriptor of ErgoTree type
Long
- 64-bit signed integer. - case object SLongMethods extends SNumericTypeMethods with Product with Serializable
Descriptor of ErgoTree type
Long
. - object SMethod extends Serializable
- object SNumericType extends STypeCompanion
- object SNumericTypeMethods extends MethodsContainer
- object SOption extends STypeCompanion with Serializable
- object SOptionMethods extends MethodsContainer
- object SPair
Helper constuctor/extractor for tuples of two types.
- case object SPreHeader extends SProduct with SPredefType with SMonoType with Product with Serializable
Type descriptor of
PreHeader
type of ErgoTree. - case object SPreHeaderMethods extends MonoTypeMethods with Product with Serializable
Type descriptor of
PreHeader
type of ErgoTree. - object SPrimType
Primitive type recognizer to pattern match on TypeCode
- case object SShort extends SPrimType with SEmbeddable with SNumericType with SMonoType with Product with Serializable
Descriptor of ErgoTree type
Short
- 16-bit signed integer. - case object SShortMethods extends SNumericTypeMethods with Product with Serializable
Methods of ErgoTree type
Short
. - case object SSigmaProp extends SProduct with SPrimType with SEmbeddable with SLogical with SMonoType with Product with Serializable
Descriptor of ErgoTree type
SigmaProp
which represent sigma-protocol propositions. - case object SSigmaPropMethods extends MonoTypeMethods with Product with Serializable
Methods of type
SigmaProp
which represent sigma-protocol propositions. - case object SString extends SProduct with SMonoType with Product with Serializable
Descriptor of type
String
which is not used in ErgoTree, but used in ErgoScript.Descriptor of type
String
which is not used in ErgoTree, but used in ErgoScript. NOTE: this descriptor both type and type companion - case object SStringMethods extends MonoTypeMethods with Product with Serializable
Methods of type
String
. - object STuple extends STypeCompanion with Serializable
- object STupleMethods extends MethodsContainer
- object SType
- object STypeApply extends Serializable
- object STypeParam extends Serializable
- object STypeVar extends Serializable
- case object SUnit extends SPrimType with SMonoType with Product with Serializable
The type with single inhabitant value
()
- case object SUnitMethods extends MonoTypeMethods with Product with Serializable
The type with single inhabitant value
()
- object Select extends ValueCompanion with Serializable
- object SelectField extends FixedCostValueCompanion with Serializable
- case object Self extends Value[SBox.type] with NotReadyValueBox with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a BoxConstant built from context.boxesToSpend(context.selfIndex)
- object SeqCostItem extends Serializable
- object ShortArrayConstant
- object ShortConstant
- object SigmaAnd extends SigmaTransformerCompanion with Serializable
- object SigmaOr extends SigmaTransformerCompanion with Serializable
- object SigmaPredef
- object SigmaPropBytes extends PerItemCostValueCompanion with Serializable
- object SigmaPropConstant
- object SigmaPropIsProven extends ValueCompanion with Serializable
- object SimpleRelation
- object SizeOf extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object Slice extends ValueCompanion with Serializable
- object SourceContext extends Serializable
- case object StdSigmaBuilder extends StdSigmaBuilder with Product with Serializable
Standard builder which don't perform any additional transformations and checking.
- object StringConstant
- object SubstConstants extends ValueCompanion with Serializable
- object TaggedVariable extends ValueCompanion
- case object TransformingSigmaBuilder extends TransformingSigmaBuilder with Product with Serializable
Builder of ErgoTree nodes which is used in SigmaCompiler.
- object TreeLookup extends QuadrupleCompanion with Serializable
- object TrueLeaf extends ConstantNode[SBoolean.type] with ValueCompanion
ErgoTree node which represents
true
literal. - object Tuple extends FixedCostValueCompanion with Serializable
- object TypeBasedCostItem extends Serializable
- object TypeCodes
Encoding of types for serialization.
- object UnitConstant
High-level interface to internal representation of Unit constants in ErgoTree.
- object Upcast extends NumericCastCompanion with Serializable
- object Val
- object ValDef extends ValueCompanion with Serializable
- object ValNode extends ValueCompanion with Serializable
- object ValUse extends FixedCostValueCompanion with Serializable
- object Value
- object ValueCompanion
- object Xor extends TwoArgumentOperationCompanion with Serializable
- object XorOf extends LogicalTransformerCompanion with Serializable
- object ZKProofBlock extends ValueCompanion with Serializable
- object syntax
Contains global definitions which define syntactic extensions for working with classes of sigma.ast package.