pub enum Access {
ThisAddress,
ThisContractAddress,
MutKeys,
RepeatCounter,
DecisionVar,
DecisionVarLen,
State,
StateLen,
NumSlots,
PredicateExists,
}Expand description
Operations for accessing input data.
Variants§
ThisAddress
0x30: THIS
Get the content hash of this predicate.
This operation returns a list of words with a length of 4, representing the hash.
§Stack Output
[key]
ThisContractAddress
0x31: THISC
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.
§Stack Output
[key]
MutKeys
0x34: MKEYS
Push the keys of the proposed state mutations onto the stack.
Note the order is non-deterministic because this is a set.
Returns only total length 0 if there are no mutations.
§Stack Output
[key_0, key_0_len, ...key_N, key_N_len, total_length]
RepeatCounter
DecisionVar
0x37: VAR
Access a range of len words starting from value_ix within the decision variable located at slot_ix.
Returns a list of decision words with length equal to the specified len.
§Stack Input
[slot_ix, value_ix, len]
§Stack Output
[word, ...]
The stack output length depends on the value of the len stack input word.
§Panics
- slot_ix is out of range.
- The range
value_ix..(value_ix + len)is out of range.
DecisionVarLen
0x38: VLEN
Get the length of a the decision variable value located at slot_ix.
§Stack Input
[slot_ix]
§Stack Output
[len]
§Panics
- slot_ix is out of range.
State
0x39
Access a range of words from the state value located in the slot at slot_ix.
Push len words from the value onto the stack, starting from the word at value_ix.
The argument delta false accesses pre state.
The argument delta true accesses post state.
§Stack Input
[slot_ix, value_ix, len, delta]
§Stack Output
[word, ...]
The stack output length depends on the value of the len stack input word.
§Panics
- slot_ix is out of range.
- The range
value_ix..(value_ix + len)is out of range. - delta is not a boolean.
StateLen
0x3A: SLEN
Get the length of a state value at a specified slot_ix.
The argument delta false accesses pre state.
The argument delta true accesses post state.
Returns the length of the state value.
§Stack Input
[slot_ix, delta]
§Stack Output
[len]
§Panics
- slot_ix is out of range.
- delta is not a boolean.
NumSlots
0x3B: NSLT
Get the number of decision var or state slots.
which_slots:
-
0for decision vars. -
1for pre state slots. -
2for post state slots.
§Stack Input
[which_slots]
§Stack Output
[len]