Expand description
Assembly for checking constraints.
§Op Table
Opcode | Op | Short Description |
---|---|---|
0x01 | Stack Push | Push one word onto the stack. |
0x02 | Stack Pop | Pop one word from the stack. |
0x03 | Stack Dup | Duplicate the top word on the stack. |
0x04 | Stack DupFrom | Duplicate the word at the given stack depth index. |
0x05 | Stack Swap | Swap top two words on stack. |
0x06 | Stack SwapIndex | Swap the top word on the stack with the word at the given stack depth index. |
0x07 | Stack Select | Conditionally keep one of the top two elements on the stack. |
0x08 | Stack SelectRange | Conditionally keep one of the top two ranges on the stack. |
0x09 | Stack Repeat | Repeat a section of code the number of times. |
0x0A | Stack RepeatEnd | Increment or decrements the top counter on the repeat stack. |
0x10 | Pred Eq | Check equality of two words. |
0x11 | Pred EqRange | Check equality of two ranges on the stack. |
0x12 | Pred Gt | Check if left-hand side is greater than right-hand side. |
0x13 | Pred Lt | Check if left-hand side is less than right-hand side. |
0x14 | Pred Gte | Check if left-hand side is greater than or equal to right-hand side. |
0x15 | Pred Lte | Check if left-hand side is less than or equal to right-hand side. |
0x16 | Pred And | Logical AND of two words. |
0x17 | Pred Or | Logical OR of two words. |
0x18 | Pred Not | Logical NOT of a word. |
0x19 | Pred EqSet | Pop two sets off the stack and check if they are equal. |
0x1A | Pred BitAnd | Bitwise AND of two words. |
0x1B | Pred BitOr | Bitwise OR of two words. |
0x20 | Alu Add | Add two words. |
0x21 | Alu Sub | Subtract two words. |
0x22 | Alu Mul | Multiply two words. |
0x23 | Alu Div | Integer division. |
0x24 | Alu Mod | Modulus of lhs by rhs. |
0x25 | Alu Shl | Logical shift left by number of bits. |
0x26 | Alu Shr | Logical shift right by number of bits. |
0x27 | Alu ShrI | Arithmetic shift right by number of bits. |
0x30 | Access ThisAddress | Get the content hash of this predicate. |
0x31 | Access ThisContractAddress | Get the content hash of the contract this predicate belongs to. |
0x32 | Access ThisPathway | Get the pathway of this predicate. |
0x33 | Access PredicateAt | Get the predicate at solution data pathway. |
0x34 | Access MutKeys | Push the keys of the proposed state mutations onto the stack. |
0x35 | Access PubVarKeys | Push the keys of the pub vars at pathway_id onto the stack. |
0x36 | Access RepeatCounter | Access the top repeat counters current value. |
0x37 | Access DecisionVar | Access a range of len words starting from value_ix within the decision variable located at slot_ix . |
0x38 | Access DecisionVarLen | Get the length of a the decision variable value located at slot_ix . |
0x39 | Access State | Access a range of words from the state value located in the slot at slot_ix . |
0x3A | Access StateLen | Get the length of a state value at a specified slot_ix . |
0x3B | Access PubVar | Access a range of public decision variable words at pathway_ix |
0x3C | Access PubVarLen | Get the length of the value indexed by pathway_ix |
0x3D | Access NumSlots | Get the number of decision var or state slots. |
0x50 | Crypto Sha256 | Produce a SHA 256 hash from the specified data. |
0x51 | Crypto VerifyEd25519 | Validate an Ed25519 signature against a public key. |
0x52 | Crypto RecoverSecp256k1 | Recover the public key from a secp256k1 signature. |
0x60 | TotalControlFlow Halt | End the execution of the program. |
0x61 | TotalControlFlow HaltIf | Halt the program if the value is true. |
0x63 | TotalControlFlow JumpForwardIf | Jump forward the given number of instructions if the value is true. |
0x64 | TotalControlFlow PanicIf | Panic if the condition is true. |
0x70 | Temporary Alloc | Allocate new memory to the end of the temporary memory. |
0x71 | Temporary Load | Load the value at the index of temporary memory onto the stack. |
0x72 | Temporary Store | Store the value at the index of temporary memory. |
Modules§
- Provides the operation type bytes iterators.
- Typed representation of the opcode, without any associated data.
- Short hand names for the operations.
Structs§
- An attempt to parse a byte as an opcode failed.
- An error occurring within
Opcode::parse_op
in the case that the provided bytes iterator contains insufficient bytes for the expected associated operation data.
Enums§
- Operations for accessing input data.
- Operations for computing arithmetic and logic.
- All operations available to the constraint checker.
- Operations providing cryptographic functionality.
- Errors that can occur while parsing ops from bytes.
- All operations available to the constraint checker.
- All operations available to the constraint checker.
- Operations for computing predicates.
- Operations related to stack manipulation.
- Operations for temporary memory.
- Control flow operations that keep the program total.
Traits§
- Operation types that may be converted to their serialized form in bytes.
- Allows for converting an
Op
into its associatedOpcode
. - Operation types that may be parsed from a bytecode representation.
Functions§
- Parse operations from the given iterator yielding bytes.
- Convert the given iterator yielding operations into and iterator yielding the serialized form in bytes.
Type Aliases§
- Single unit of data.