Duplicate the word at the given stack depth index. 0 is the index of the element at the top of the stack.
Swap: 0x5
a, b
b, a
Swap top two words on stack.
SwapIndex: 0x6
a, b, c, d, index
a, d, c, b
Index is out of range.
Swap the top word on the stack with the word at the given stack depth index. 0 is the index of the element at the top of the stack.
Select: 0x7
a, b, cond
b
Conditionally keep one of the top two elements on the stack. If condition is true, the top element is kept.
SelectRange: 0x8
arr_a_0, ..arr_a_N, arr_b_0, ..arr_b_N, len, cond
arr_b_0, ..arr_b_N
Conditionally keep one of the top two ranges on the stack. If condition is true, the top range is kept. The ranges must be of equal length. The ranges must be stacked sequentially. Here N is len -1.
Repeat: 0x9
num_repeats, count_up_bool
Repeat a section of code the number of times. Takes a boolean to either count from 0 up or from the number of repeats down to 0.
RepeatEnd: 0xA
If there is no counter on the repeat stack., If there is no repeat registered to return to.
Increment or decrements the top counter on the repeat stack. If the counter is counting up and counter == limit - 1 then this pops the counter and continues with the program. If the counter is counting down and the counter is 0 then this pops the counter and continues with the program. If it is < limit - 1 or > 0 respectively then the program jumps to the last Repeat
Access the first word in a decision variable slot by slot. The slot must be in range. Returns a decision word.
DecisionVarAt: 0x31
slot, index
decision_word
The slot is out of range., The index is out of range.
Access a word in a decision variable slot by slot and index. The slot and index must be in range. Returns a decision word.
DecisionVarRange: 0x32
slot, index, len
elem: decision_word len: range
The slot is out of range., The range index..(index + len) is out of range.
Access a range of decision variables slot words starting from a specified slot and index. Returns a list of decision words with length equal to the specified len.
DecisionVarLen: 0x33
slot
len
The slot is out of range.
Get the length of a specified slot.
State: 0x34
slot, delta
state_slot_w0, ...state_slot_wN
The slot is out of range.
Access a state variable by slot. If the slot is empty, this is a noop. The delta parameter determines if changes are considered. Use StateLen to get the length of the state variable.
Access a range of state variables starting from a specified slot. Empty slots will not write anything to the stack. The delta parameter determines if changes are considered. Returns a list of state words with length equal to the specified range. Use StateLenRange to get the lengths of the state variables.
StateLen: 0x36
slot, delta
len
The slot is out of range.
Get the length of a state variable at a specified slot. Returns a the length of the state variable.
StateLenRange: 0x37
slot, range, delta
elem: length len: range
The range slot..(slot + range) is out of range.
Get the lengths of a range of state variables starting from a specified slot. Returns a list of lengths, each being the length of a state variable in the range.
MutKeysLen: 0x38
word
Get the number of mutable keys being proposed for mutation. This operation returns a single word representing the length.
MutKeysContains: 0x39
key, key_len
bool
Check if the mutable keys being proposed contain the given key. This operation returns a true if the key is found, false otherwise.
ThisAddress: 0x3A
key
Get the content hash of this predicate. This operation returns a list of words with a length of 4, representing the hash.
ThisContractAddress: 0x3B
key
Get the content hash of the contract this predicate belongs to. This operation returns a list of words with a length of 4, representing the contract's hash.
ThisPathway: 0x3C
in
Get the pathway of this predicate. This operation returns the index of the solution data currently being used to check this predicate.
RepeatCounter: 0x3D
counter_value
Access the top repeat counters current value.
Transient: 0x3E
key_0, ...key_N, key_len, pathway
elem: slot_word len: value_len
Get the solution data indexed by pathway and key.
TransientLen: 0x3F
key_0, ...key_N, key_len, pathway
len
Get the length of solution data indexed by pathway and key.
Read a range of values at each key from state starting at the key into state slots starting at the slot index. The key is lexographically incremented for each value read. All keys are assumed to be the same length. Returns the values onto the stack, followed by their indices.
Read a range of values at each key from external state starting at the key into state slots starting at the slot index. The key is lexographically incremented for each value read. The external state is at the ext address. Returns the values onto the stack, followed by their indices.