Packages

  • package root
    Definition Classes
    root
  • package sigma

    The following implicit values are used as type descriptors of all the predefined Sigma types.

    The following implicit values are used as type descriptors of all the predefined Sigma types.

    Definition Classes
    root
    See also

    RType class

  • package data

    Contains cores definitions which serves as a basis for sigma package implementations.

    Contains cores definitions which serves as a basis for sigma package implementations.

    Definition Classes
    sigma
  • package impl
    Definition Classes
    sigma
  • package kiama

    Kiama is a Scala library for language processing.

    Kiama is a Scala library for language processing. It is a project of the Programming Languages Research Group at Macquarie University. For full project details see the web site http://github.com/inkytonik/kiama.

    Kiama's main components address tree decoration via attribute grammars (package attribution), tree transformation via strategic term rewriting (package rewriting), dynamic semantics (package machine) and pretty-printing (package output).

    The util package contains support modules for parsing, input/output, read-eval-print loops (REPLs) and pattern matching.

    The examples package (available as part of the Kiama tests) contains many examples of using Kiama to solve small to medium language processing problems.

    Definition Classes
    sigma
  • package reflection

    Contains the Sigma Reflection API.

    Contains the Sigma Reflection API. Sigma reflection is a mechanism for obtaining metadata about classes, methods, fields, etc. at runtime. It is used by kiama to rewrite ErgoTree expressions. It is also used by the ErgoTree interpreter to implement MethodCall nodes.

    The Sigma Reflection API has two implementations: 1) based on the Java Reflection API 2) based on Sigma Reflection metadata declared in the StaticImpl.scala file

    Definition Classes
    sigma
  • package util
    Definition Classes
    sigma
  • package wrappers
    Definition Classes
    sigma
  • AnyValue
  • AvlTree
  • BigInt
  • Box
  • Coll
  • CollBuilder
  • Colls
  • CollsModule
  • Context
  • Environment
  • Extensions
  • GroupElement
  • Header
  • PairColl
  • PreHeader
  • RuntimePlatform
  • SigmaContract
  • SigmaDsl
  • SigmaDslBuilder
  • SigmaDslModule
  • SigmaProp
  • VersionContext
t

sigma

Box

trait Box extends AnyRef

Runtime representation of Ergo boxes used during execution of ErgoTree operations.

See also

org.ergoplatform.ErgoBox

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Box
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def bytes: Coll[Byte]

    Serialized bytes of this box's content, including proposition bytes.

  2. abstract def bytesWithoutRef: Coll[Byte]

    Serialized bytes of this box's content, excluding transactionId and index of output.

  3. abstract def creationInfo: (Int, Coll[Byte])

    If tx is a transaction which generated this box, then creationInfo._1 is a height of the tx's block.

    If tx is a transaction which generated this box, then creationInfo._1 is a height of the tx's block. The creationInfo._2 is a serialized transaction identifier followed by box index in the transaction outputs.

  4. abstract def executeFromRegister[T](regId: Byte)(implicit cT: RType[T]): T

    Extracts register as Coll[Byte], deserializes it to script and then executes this script in the current context.

    Extracts register as Coll[Byte], deserializes it to script and then executes this script in the current context. The original Coll[Byte] of the script is available as getReg[Coll[Byte]](id)

    T

    result type of the deserialized script.

    regId

    identifier of the register

    returns

    result of the script execution in the current context

    Since

    Mainnet

    Exceptions thrown

    IllegalArgumentException if the actual script type doesn't conform to T

  5. abstract def getReg[T](i: Int)(implicit cT: RType[T]): Option[T]

    Extracts register by id and type.

    Extracts register by id and type. ErgoScript is typed, so accessing a register is an operation which involves some expected type given in brackets. Thus SELF.R4[Int] expression should evaluate to a valid value of the Option[Int] type.

    For example val x = SELF.R4[Int] expects the register, if it is present, to have type Int. At runtime the corresponding type descriptor is passed as cT parameter.

    There are three cases: 1) If the register doesn't exist. Then val x = SELF.R4[Int] succeeds and returns the None value, which conforms to any value of type Option[T] for any T. (In the example above T is equal to Int). Calling x.get fails when x is equal to None, but x.isDefined succeeds and returns false. 2) If the register contains a value v of type Int. Then val x = SELF.R4[Int] succeeds and returns Some(v), which is a valid value of type Option[Int]. In this case, calling x.get succeeds and returns the value v of type Int. Calling x.isDefined returns true. 3) If the register contains a value v of type T other then Int. Then val x = SELF.R4[Int] fails, because there is no way to return a valid value of type Option[Int]. The value of register is present, so returning it as None would break the typed semantics of registers collection.

    In some use cases one register may have values of different types. To access such register an additional register can be used as a tag.

      val tagOpt = SELF.R5[Int]
      val res = if (tagOpt.isDefined) {
        val tag = tagOpt.get
        if (tag == 1) {
          val x = SELF.R4[Int].get
          // compute res using value x is of type Int
        } else if (tag == 2) {
          val x = SELF.R4[GroupElement].get
          // compute res using value x is of type GroupElement
        } else if (tag == 3) {
          val x = SELF.R4[ Array[Byte] ].get
          // compute res using value x of type Array[Byte]
        } else {
          // compute `res` when `tag` is not 1, 2 or 3
        }
      }
      else {
        // compute value of res when register is not present
      }
    

    T

    expected type of the register.

    i

    zero-based identifier of the register.

    returns

    Some(value) if the register is defined AND has the given type. None otherwise

    Since

    2.0

    Exceptions thrown

    `sigmastate.eval.InvalidType` exception when the type of the register value is different from cT.

  6. abstract def id: Coll[Byte]

    Blake2b256 hash of this box's content, basically equals to blake2b256(bytes)

  7. abstract def propositionBytes: Coll[Byte]

    Serialized bytes of guarding script, which should be evaluated to true in order to open this box.

    Serialized bytes of guarding script, which should be evaluated to true in order to open this box. (aka spend it in a transaction)

  8. abstract def registers: Coll[AnyValue]
  9. abstract def tokens: Coll[(Coll[Byte], Long)]

    Secondary tokens

  10. abstract def value: Long

    Mandatory: Monetary value, in Ergo tokens (NanoErg unit of measure)

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def R0[T](implicit cT: RType[T]): Option[T]

    Mandatory: Monetary value, in Ergo tokens

  5. def R1[T](implicit cT: RType[T]): Option[T]

    Mandatory: Guarding script

  6. def R2[T](implicit cT: RType[T]): Option[T]

    Mandatory: Secondary tokens

  7. def R3[T](implicit cT: RType[T]): Option[T]

    Mandatory: Reference to transaction and output id where the box was created

  8. def R4[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  9. def R5[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  10. def R6[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  11. def R7[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  12. def R8[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  13. def R9[T](implicit cT: RType[T]): Option[T]

    Non-mandatory register

  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    Box → AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped