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. |
0x0B | Stack Reserve | Reserve space on the stack for len words. |
0x0C | Stack Load | Load the value at the given stack depth index relative to the bottom. |
0x0D | Stack Store | Store the value at the given stack depth index relative to the bottom. |
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. |
0x34 | Access MutKeys | Push the keys of the proposed state mutations 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 NumSlots | Get the number of decision var or state slots. |
0x3C | Access PredicateExists | Check if a solution to a predicate exists within the same solution |
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 a new block of memory to the end of the temporary memory. |
0x71 | Temporary Free | Free memory down to the specified index. |
0x72 | Temporary Load | Load the value at the index of temporary memory onto the stack. |
0x73 | Temporary Store | Store the value at the index of temporary memory. |
0x74 | Temporary LoadRange | Load a range of words starting at the index of temporary memory. |
0x75 | Temporary StoreRange | Store a range of words starting at the index of temporary memory. |
Modules§
- bytes_
iter - Provides the operation type bytes iterators.
- opcode
- Typed representation of the opcode, without any associated data.
- short
- Short hand names for the operations.
Structs§
- Invalid
Opcode Error - An attempt to parse a byte as an opcode failed.
- NotEnough
Bytes Error - 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§
- Access
- Operations for accessing input data.
- Alu
- Operations for computing arithmetic and logic.
- Constraint
- All operations available to the constraint checker.
- Crypto
- Operations providing cryptographic functionality.
- From
Bytes Error - Errors that can occur while parsing ops from bytes.
- Op
- All operations available to the constraint checker.
- Opcode
- All operations available to the constraint checker.
- Pred
- Operations for computing predicates.
- Stack
- Operations related to stack manipulation.
- Temporary
- Operations for temporary memory.
- Total
Control Flow - Control flow operations that keep the program total.
Traits§
- ToBytes
- Operation types that may be converted to their serialized form in bytes.
- ToOpcode
- Allows for converting an
Op
into its associatedOpcode
. - TryFrom
Bytes - Operation types that may be parsed from a bytecode representation.
Functions§
- from_
bytes - Parse operations from the given iterator yielding bytes.
- to_
bytes - Convert the given iterator yielding operations into and iterator yielding the serialized form in bytes.
Type Aliases§
- Word
- Single unit of data.