Class/Object

sigmastate.eval

CostingBox

Related Docs: object CostingBox | package eval

Permalink

case class CostingBox(isCost: Boolean, ebox: ErgoBox) extends Box with WrapperOf[ErgoBox] with Product with Serializable

A default implementation of Box interface.

See also

Box for detailed descriptions

Linear Supertypes
Serializable, Serializable, Product, Equals, WrapperOf[ErgoBox], Box, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CostingBox
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. WrapperOf
  7. Box
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CostingBox(isCost: Boolean, ebox: ErgoBox)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def R0[T](implicit cT: RType[T]): Option[T]

    Permalink

    Mandatory: Monetary value, in Ergo tokens

    Mandatory: Monetary value, in Ergo tokens

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

    Permalink

    Mandatory: Guarding script

    Mandatory: Guarding script

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

    Permalink

    Mandatory: Secondary tokens

    Mandatory: Secondary tokens

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

    Permalink

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

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

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

    Permalink

    Non-mandatory register

    Non-mandatory register

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

    Permalink

    Non-mandatory register

    Non-mandatory register

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

    Permalink

    Non-mandatory register

    Non-mandatory register

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

    Permalink

    Non-mandatory register

    Non-mandatory register

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

    Permalink

    Non-mandatory register

    Non-mandatory register

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

    Permalink

    Non-mandatory register

    Non-mandatory register

    Definition Classes
    Box
  14. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  15. val builder: CostingSigmaDslBuilder.type

    Permalink
  16. lazy val bytes: Coll[Byte]

    Permalink

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

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

    Definition Classes
    CostingBoxBox
  17. lazy val bytesWithoutRef: Coll[Byte]

    Permalink

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

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

    Definition Classes
    CostingBoxBox
  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  19. def creationInfo: (Int, Coll[Byte])

    Permalink

    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.

    Definition Classes
    CostingBoxBox
  20. val ebox: ErgoBox

    Permalink
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(obj: Any): Boolean

    Permalink
    Definition Classes
    CostingBox → Equals → AnyRef → Any
  23. def executeFromRegister[T](regId: Byte)(implicit cT: RType[T]): T

    Permalink

    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

    Definition Classes
    CostingBoxBox
    Since

    Mainnet

    Exceptions thrown

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

  24. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  25. def getReg[T](i: Int)(implicit tT: RType[T]): Option[T]

    Permalink

    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

    Definition Classes
    CostingBoxBox
    Since

    2.0

    Exceptions thrown

    special.sigma.InvalidType exception when the type of the register value is different from cT.

  26. def hashCode(): Int

    Permalink
    Definition Classes
    CostingBox → AnyRef → Any
  27. lazy val id: Coll[Byte]

    Permalink

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

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

    Definition Classes
    CostingBoxBox
  28. val isCost: Boolean

    Permalink
  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  33. lazy val propositionBytes: Coll[Byte]

    Permalink

    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)

    Definition Classes
    CostingBoxBox
  34. lazy val registers: Coll[AnyValue]

    Permalink
    Definition Classes
    CostingBoxBox
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    Box → AnyRef → Any
    Annotations
    @Internal()
  37. def tokens: Coll[(Coll[Byte], Long)]

    Permalink

    Secondary tokens

    Secondary tokens

    Definition Classes
    CostingBoxBox
  38. val value: Long

    Permalink

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

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

    Definition Classes
    CostingBoxBox
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. def wrappedValue: ErgoBox

    Permalink

    The data value wrapped by this wrapper.

    The data value wrapped by this wrapper.

    Definition Classes
    CostingBoxWrapperOf

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from WrapperOf[ErgoBox]

Inherited from Box

Inherited from AnyRef

Inherited from Any

Ungrouped