Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ast/TernaryExpr

Index

Functions

ed25519Verify

  • Verify the ed25519 signature of the concatenation ("ProgData" + hash_of_current_program + data).

    Parameters

    • data: Expr

      The data signed by the public key. Must evaluate to bytes.

    • sig: Expr

      The proposed 64-byte signature of the concatenation ("ProgData" + hash_of_current_program + data). Must evaluate to bytes.

    • key: Expr

      The 32 byte public key that produced the signature. Must evaluate to bytes.

    Returns TernaryExpr

setBit

  • Set the bit value of an expression at a specific index.

    The meaning of index differs if value is an integer or a byte string.

    • For integers, bit indexing begins with low-order bits. For example, setBit(new Int(0), new Int(4), new Int(1)) yields the integer 16 (2^4). Any integer less than 64 is a valid index.

    • For byte strings, bit indexing begins at the first byte. For example, setBit(new Bytes("base16", "0x00"), new Int(7), new Int(1)) yields the byte string 0x01. Any integer less than 8*value.length is a valid index.

    Requires TEAL version 3 or higher.

    Parameters

    • value: Expr

      The value containing bits. Can evaluate to any type.

    • index: Expr

      The index of the bit to set. Must evaluate to uint64.

    • newBitValue: Expr

      The new bit value to set. Must evaluate to the integer 0 or 1.

    Returns TernaryExpr

setByte

  • Set a single byte in a byte string from an integer value.

    Similar to SetBit, indexing begins at the first byte.

    Requires TEAL version 3 or higher.

    example

    setByte(new Bytes("base16", "0x000000"), new Int(0), new Int(255)) yields the byte string 0xff0000.

    Parameters

    • value: Expr

      The value containing the bytes. Must evaluate to bytes.

    • index: Expr

      The index of the byte to set. Must evaluate to an integer less than Len(value).

    • newByteValue: Expr

      The new byte value to set. Must evaluate to an integer less than 256.

    Returns TernaryExpr

substring

  • Take a substring of a byte string.

    Produces a new byte string consisting of the bytes starting at start up to but not including end.

    Parameters

    • string: Expr

      The byte string.

    • start: Expr

      The starting index for the substring. Must be an integer less than or equal to string.length.

    • end: Expr

      The ending index for the substring. Must be an integer greater or equal to start, but less than or equal to string.length.

    Returns TernaryExpr

Generated using TypeDoc