41 for (
const auto& param : params) {
46 if (
tag.has_value()) {
55#ifdef DISABLE_ADD_8_INSTRUCTION
61 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
79#ifdef DISABLE_SUB_8_INSTRUCTION
85 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
102#ifdef DISABLE_MUL_8_INSTRUCTION
108 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
117 .
operand(result.value().second)
125#ifdef DISABLE_DIV_8_INSTRUCTION
131 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
140 .
operand(result.value().second)
148#ifdef DISABLE_EQ_8_INSTRUCTION
154 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
163 .
operand(result.value().second)
171#ifdef DISABLE_LT_8_INSTRUCTION
177 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
186 .
operand(result.value().second)
194#ifdef DISABLE_LTE_8_INSTRUCTION
200 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
209 .
operand(result.value().second)
217#ifdef DISABLE_AND_8_INSTRUCTION
223 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
233 .
operand(result.value().second)
241#ifdef DISABLE_OR_8_INSTRUCTION
247 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
257 .
operand(result.value().second)
265#ifdef DISABLE_XOR_8_INSTRUCTION
271 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
281 .
operand(result.value().second)
289#ifdef DISABLE_SHL_8_INSTRUCTION
295 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
305 .
operand(result.value().second)
313#ifdef DISABLE_SHR_8_INSTRUCTION
319 if (!
a.has_value() || !
b.has_value() || !result.has_value()) {
329 .
operand(result.value().second)
337#ifdef DISABLE_SET_8_INSTRUCTION
341 if (!effective_address_operand.has_value()) {
346 .operand(effective_address_operand.value().second)
351 effective_address_operand.value().first.absolute_address);
356#ifdef DISABLE_SET_16_INSTRUCTION
360 if (!effective_address_operand.has_value()) {
365 .operand(effective_address_operand.value().second)
370 effective_address_operand.value().first.absolute_address);
375#ifdef DISABLE_SET_32_INSTRUCTION
379 if (!effective_address_operand.has_value()) {
384 .operand(effective_address_operand.value().second)
389 effective_address_operand.value().first.absolute_address);
394#ifdef DISABLE_SET_64_INSTRUCTION
398 if (!effective_address_operand.has_value()) {
403 .operand(effective_address_operand.value().second)
408 effective_address_operand.value().first.absolute_address);
413#ifdef DISABLE_SET_128_INSTRUCTION
417 if (!effective_address_operand.has_value()) {
424 .operand(effective_address_operand.value().second)
429 effective_address_operand.value().first.absolute_address);
434#ifdef DISABLE_SET_FF_INSTRUCTION
438 if (!effective_address_operand.has_value()) {
443 .operand(effective_address_operand.value().second)
448 effective_address_operand.value().first.absolute_address);
453#ifdef DISABLE_MOV_8_INSTRUCTION
458 if (!src_address_operand.has_value() || !result_address_operand.has_value()) {
464 .
operand(src_address_operand.value().second)
465 .
operand(result_address_operand.value().second)
473#ifdef DISABLE_MOV_16_INSTRUCTION
478 if (!src_address_operand.has_value() || !result_address_operand.has_value()) {
485 .
operand(src_address_operand.value().second)
486 .
operand(result_address_operand.value().second)
494#ifdef DISABLE_FDIV_8_INSTRUCTION
500 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
508 .
operand(a_address_operand.value().second)
509 .
operand(b_address_operand.value().second)
510 .
operand(result_address_operand.value().second)
514 result_address_operand.value().first);
519#ifdef DISABLE_NOT_8_INSTRUCTION
524 if (!a_address_operand.has_value() || !result_address_operand.has_value()) {
531 .
operand(a_address_operand.value().second)
532 .
operand(result_address_operand.value().second)
540#ifdef DISABLE_ADD_16_INSTRUCTION
546 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
554 .
operand(a_address_operand.value().second)
555 .
operand(b_address_operand.value().second)
556 .
operand(result_address_operand.value().second)
560 result_address_operand.value().first);
565#ifdef DISABLE_SUB_16_INSTRUCTION
571 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
579 .
operand(a_address_operand.value().second)
580 .
operand(b_address_operand.value().second)
581 .
operand(result_address_operand.value().second)
585 result_address_operand.value().first);
590#ifdef DISABLE_MUL_16_INSTRUCTION
596 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
604 .
operand(a_address_operand.value().second)
605 .
operand(b_address_operand.value().second)
606 .
operand(result_address_operand.value().second)
610 result_address_operand.value().first);
615#ifdef DISABLE_DIV_16_INSTRUCTION
621 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
629 .
operand(a_address_operand.value().second)
630 .
operand(b_address_operand.value().second)
631 .
operand(result_address_operand.value().second)
635 result_address_operand.value().first);
640#ifdef DISABLE_FDIV_16_INSTRUCTION
646 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
654 .
operand(a_address_operand.value().second)
655 .
operand(b_address_operand.value().second)
656 .
operand(result_address_operand.value().second)
660 result_address_operand.value().first);
665#ifdef DISABLE_EQ_16_INSTRUCTION
671 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
679 .
operand(a_address_operand.value().second)
680 .
operand(b_address_operand.value().second)
681 .
operand(result_address_operand.value().second)
689#ifdef DISABLE_LT_16_INSTRUCTION
695 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
703 .
operand(a_address_operand.value().second)
704 .
operand(b_address_operand.value().second)
705 .
operand(result_address_operand.value().second)
713#ifdef DISABLE_LTE_16_INSTRUCTION
719 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
727 .
operand(a_address_operand.value().second)
728 .
operand(b_address_operand.value().second)
729 .
operand(result_address_operand.value().second)
737#ifdef DISABLE_AND_16_INSTRUCTION
743 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
751 .
operand(a_address_operand.value().second)
752 .
operand(b_address_operand.value().second)
753 .
operand(result_address_operand.value().second)
757 result_address_operand.value().first);
762#ifdef DISABLE_OR_16_INSTRUCTION
768 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
776 .
operand(a_address_operand.value().second)
777 .
operand(b_address_operand.value().second)
778 .
operand(result_address_operand.value().second)
782 result_address_operand.value().first);
787#ifdef DISABLE_XOR_16_INSTRUCTION
793 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
801 .
operand(a_address_operand.value().second)
802 .
operand(b_address_operand.value().second)
803 .
operand(result_address_operand.value().second)
807 result_address_operand.value().first);
812#ifdef DISABLE_NOT_16_INSTRUCTION
817 if (!a_address_operand.has_value() || !result_address_operand.has_value()) {
824 .
operand(a_address_operand.value().second)
825 .
operand(result_address_operand.value().second)
833#ifdef DISABLE_SHL_16_INSTRUCTION
839 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
847 .
operand(a_address_operand.value().second)
848 .
operand(b_address_operand.value().second)
849 .
operand(result_address_operand.value().second)
853 result_address_operand.value().first);
858#ifdef DISABLE_SHR_16_INSTRUCTION
864 if (!a_address_operand.has_value() || !b_address_operand.has_value() || !result_address_operand.has_value()) {
872 .
operand(a_address_operand.value().second)
873 .
operand(b_address_operand.value().second)
874 .
operand(result_address_operand.value().second)
878 result_address_operand.value().first);
883#ifdef DISABLE_CAST_8_INSTRUCTION
888 if (!src_address_operand.has_value() || !result_address_operand.has_value()) {
895 .
operand(src_address_operand.value().second)
896 .
operand(result_address_operand.value().second)
901 result_address_operand.value().first.absolute_address);
906#ifdef DISABLE_CAST_16_INSTRUCTION
911 if (!src_address_operand.has_value() || !result_address_operand.has_value()) {
918 .
operand(src_address_operand.value().second)
919 .
operand(result_address_operand.value().second)
924 result_address_operand.value().first.absolute_address);
929#ifdef DISABLE_SSTORE_INSTRUCTION
934 if (!src_address_operand.has_value() || !result_address_operand.has_value()) {
944 .
operand(src_address_operand.value().second)
945 .
operand(result_address_operand.value().second)
953#ifdef DISABLE_SLOAD_INSTRUCTION
957 if (!slot_addr.has_value()) {
963 .value = *slot_addr };
967 if (!slot_address_operand.has_value() || !result_address_operand.has_value()) {
974 .
operand(slot_address_operand.value().second)
975 .
operand(result_address_operand.value().second)
983#ifdef DISABLE_GETENVVAR_INSTRUCTION
987 if (!result_address_operand.has_value()) {
992 .
operand(result_address_operand.value().second)
999 result_address_operand.value().first.absolute_address);
1002 result_address_operand.value().first.absolute_address);
1008#ifdef DISABLE_EMITNULLIFIER_INSTRUCTION
1012 if (!nullifier_address_operand.has_value()) {
1017 .
operand(nullifier_address_operand.value().second)
1024#ifdef DISABLE_NULLIFIEREXISTS_INSTRUCTION
1028 auto contract_address_operand =
1031 if (!nullifier_address_operand.has_value() || !contract_address_operand.has_value() ||
1032 !result_address_operand.has_value()) {
1039 auto get_contract_address_instruction =
1044 .
operand(nullifier_address_operand.value().second)
1045 .
operand(contract_address_operand.value().second)
1046 .
operand(result_address_operand.value().second)
1054#ifdef DISABLE_EMITNOTEHASH_INSTRUCTION
1064 if (!note_hash_address_operand.has_value()) {
1070 .
operand(note_hash_address_operand.value().second)
1077#ifdef DISABLE_NOTEHASHEXISTS_INSTRUCTION
1081 auto leaf_index_address_operand =
1084 if (!notehash_address_operand.has_value() || !leaf_index_address_operand.has_value() ||
1085 !result_address_operand.has_value()) {
1093 .
operand(notehash_address_operand.value().second)
1094 .
operand(leaf_index_address_operand.value().second)
1095 .
operand(result_address_operand.value().second)
1103#ifdef DISABLE_CALLDATACOPY_INSTRUCTION
1109 if (!copy_size_address_operand.has_value() || !cd_offset_address_operand.has_value() ||
1110 !dst_address_operand.has_value()) {
1118 .
operand(copy_size_address_operand.value().second)
1119 .
operand(cd_offset_address_operand.value().second)
1120 .
operand(dst_address_operand.value().second)
1127#ifdef DISABLE_SENDL2TOL1MSG_INSTRUCTION
1141 if (!recipient_address_operand.has_value() || !content_address_operand.has_value()) {
1147 .
operand(recipient_address_operand.value().second)
1148 .
operand(content_address_operand.value().second)
1155#ifdef DISABLE_EMITUNENCRYPTEDLOG_INSTRUCTION
1159 auto log_values_address_operand =
1161 if (!log_size_address_operand.has_value() || !log_values_address_operand.has_value()) {
1166 auto emitunencryptedlog_instruction =
1168 .
operand(log_size_address_operand.value().second)
1169 .
operand(log_values_address_operand.value().second)
1171 instructions.push_back(emitunencryptedlog_instruction);
1176#ifdef DISABLE_CALL_INSTRUCTION
1196 .result_address =
instruction.calldata_size_address,
1197 .value =
static_cast<uint32_t
>(
instruction.calldata_size) });
1199 auto call_instruction_builder =
instruction.is_static_call
1202 auto call_instruction = call_instruction_builder.operand(
l2_gas.value().second)
1203 .operand(
da_gas.value().second)
1213#ifdef DISABLE_RETURNDATASIZE_INSTRUCTION
1217 if (!dst_address_operand.has_value()) {
1222 .
operand(dst_address_operand.value().second)
1230#ifdef DISABLE_RETURNDATACOPY_INSTRUCTION
1236 if (!copy_size_address_operand.has_value() || !rd_offset_address_operand.has_value() ||
1237 !dst_address_operand.has_value()) {
1245 .
operand(copy_size_address_operand.value().second)
1246 .
operand(rd_offset_address_operand.value().second)
1247 .
operand(dst_address_operand.value().second)
1254#ifdef DISABLE_GETCONTRACTINSTANCE_INSTRUCTION
1267 auto get_contract_instance_instruction =
1273 instructions.push_back(get_contract_instance_instruction);
1280#ifdef DISABLE_SUCCESSCOPY_INSTRUCTION
1284 if (!dst_address_operand.has_value()) {
1289 .
operand(dst_address_operand.value().second)
1297#ifdef DISABLE_ECADD_INSTRUCTION
1308 if (!p1_x.has_value() || !p1_y.has_value() || !p1_inf.has_value() || !p2_x.has_value() || !p2_y.has_value() ||
1309 !p2_inf.has_value() || !result.has_value()) {
1324 .
operand(p1_inf.value().second)
1327 .
operand(p2_inf.value().second)
1328 .
operand(result.value().second)
1340#ifdef DISABLE_POSEIDON2PERM_INSTRUCTION
1346 if (!src.has_value() || !dst.has_value()) {
1360 for (uint32_t i = 0; i < 4; i++) {
1367#ifdef DISABLE_KECCAKF1600_INSTRUCTION
1373 if (!src.has_value() || !dst.has_value()) {
1387 for (uint32_t i = 0; i < 25; i++) {
1394#ifdef DISABLE_SHA256COMPRESSION_INSTRUCTION
1401 if (!state.has_value() || !input.has_value() || !dst.has_value()) {
1411 .
operand(state.value().second)
1412 .
operand(input.value().second)
1417 for (uint32_t i = 0; i < 8; i++) {
1428 if (!msg_hash_operand.has_value() || !leaf_index_operand.has_value() || !result_operand.has_value()) {
1437 .
operand(msg_hash_operand.value().second)
1438 .
operand(leaf_index_operand.value().second)
1439 .
operand(result_operand.value().second)
1453 if (!value_operand.has_value() || !radix_operand.has_value() || !num_limbs_operand.has_value() ||
1454 !output_bits_operand.has_value() || !dst_operand.has_value()) {
1465 .
operand(value_operand.value().second)
1466 .
operand(radix_operand.value().second)
1467 .
operand(num_limbs_operand.value().second)
1468 .
operand(output_bits_operand.value().second)
1469 .
operand(dst_operand.value().second)
1486 if (!level_operand.has_value() || !message_operand.has_value() || !fields_operand.has_value() ||
1487 !fields_size_operand.has_value()) {
1497 .
operand(level_operand.value().second)
1498 .
operand(message_operand.value().second)
1499 .
operand(fields_operand.value().second)
1500 .
operand(fields_size_operand.value().second)
1513 auto internalreturn_instruction =
1520 if (!return_addr.has_value()) {
1526 uint16_t return_size_offset = 5U;
1536 .
operand(
static_cast<uint16_t
>(return_size_offset))
1544 uint16_t revert_value_offset_index)
1549 if (!revert_addr.has_value()) {
1554 uint16_t revert_size_offset = 5U;
1559 .
operand(
static_cast<uint16_t
>(revert_size))
1564 .
operand(
static_cast<uint16_t
>(revert_size_offset))
1576 if (copy_memory_manager) {
1584 bool copy_memory_manager)
1594 if (copy_memory_manager) {
1602 auto internalcall_instruction =
1614 auto internalcall_instruction =
instructions.at(instruction_index);
1615 if (target_block->offset == -1) {
1616 throw std::runtime_error(
"Target block offset is not set, should not happen");
1618 auto internalcall_instruction_builder =
1620 .
operand(
static_cast<uint32_t
>(target_block->offset));
1629 if (!condition_addr.has_value()) {
1632 return condition_addr;
1656 for (
const auto& instr : instruction_block.
instructions) {
1751 [](
auto) {
throw std::runtime_error(
"Unknown instruction"); },
::FuzzInstruction FuzzInstruction
std::optional< uint16_t > get_memory_offset_16(bb::avm2::MemoryTag tag, uint32_t address_index)
std::optional< std::pair< ResolvedAddress, bb::avm2::testing::OperandBuilder > > get_resolved_address_and_operand_8(ParamRef address)
std::optional< bb::avm2::FF > get_slot(uint16_t slot_offset_index)
bool is_memory_address_set(uint16_t address)
void set_memory_address(bb::avm2::MemoryTag tag, uint32_t address)
void append_slot(bb::avm2::FF slot)
void set_base_offset(uint32_t base_offset)
std::optional< std::pair< ResolvedAddress, bb::avm2::testing::OperandBuilder > > get_resolved_address_and_operand_16(ParamRef address)
void process_shr_16_instruction(SHR_16_Instruction instruction)
void process_set_8_instruction(SET_8_Instruction instruction)
void process_poseidon2perm_instruction(POSEIDON2PERM_Instruction instruction)
std::vector< ProgramBlock * > predecessors
void process_sload_instruction(SLOAD_Instruction instruction)
void finalize_with_return(uint8_t return_size, MemoryTagWrapper return_value_tag, uint16_t return_value_offset_index)
finalize the program block with a return instruction Tries to find memory address with the given retu...
std::vector< bb::avm2::simulation::Instruction > get_instructions()
void preprocess_memory_addresses(ResolvedAddress resolved_address)
preprocess the memory addresses Sets M[0] = base_offset for Relative/IndirectRelative modes Sets M[po...
void insert_internal_call(ProgramBlock *target_block)
insert INTERNALCALL instruction with 0 offset
bool is_memory_address_set(uint16_t address)
void process_emitnotehash_instruction(EMITNOTEHASH_Instruction instruction)
void process_xor_16_instruction(XOR_16_Instruction instruction)
ProgramBlock * caller
the block that called this block by INTERNALCALL This field is copied to predecessors on every CFG in...
void process_or_16_instruction(OR_16_Instruction instruction)
void patch_internal_calls()
in insert_internal_call we insert INTERNALCALL instruction with 0 offset, because we don't know the r...
void finalize_with_jump(ProgramBlock *target_block, bool copy_memory_manager=true)
finalize the block with a jump Sets the terminator type to JUMP, adds the target block to the success...
void process_debuglog_instruction(DEBUGLOG_Instruction instruction)
void process_returndatacopy_instruction(RETURNDATACOPY_Instruction instruction)
uint16_t condition_offset_index
the offset index of the condition variable (for JUMP_IF)
void process_lte_16_instruction(LTE_16_Instruction instruction)
void process_eq_8_instruction(EQ_8_Instruction instruction)
void process_keccakf1600_instruction(KECCAKF1600_Instruction instruction)
void process_fdiv_8_instruction(FDIV_8_Instruction instruction)
void process_nullifierexists_instruction(NULLIFIEREXISTS_Instruction instruction)
void process_not_8_instruction(NOT_8_Instruction instruction)
void process_add_8_instruction(ADD_8_Instruction instruction)
void finalize_with_revert(uint8_t revert_size, MemoryTagWrapper revert_value_tag, uint16_t revert_value_offset_index)
finalize the program block with a revert instruction Similar to finalize_with_return but uses REVERT ...
void process_and_16_instruction(AND_16_Instruction instruction)
MemoryManager memory_manager
void process_sub_8_instruction(SUB_8_Instruction instruction)
void process_shl_8_instruction(SHL_8_Instruction instruction)
void process_notehashexists_instruction(NOTEHASHEXISTS_Instruction instruction)
void process_div_16_instruction(DIV_16_Instruction instruction)
void process_instruction(FuzzInstruction instruction)
process the instruction
void process_toradixbe_instruction(TORADIXBE_Instruction instruction)
void process_emitnulifier_instruction(EMITNULLIFIER_Instruction instruction)
void process_fdiv_16_instruction(FDIV_16_Instruction instruction)
void process_shl_16_instruction(SHL_16_Instruction instruction)
void process_mul_16_instruction(MUL_16_Instruction instruction)
void process_set_ff_instruction(SET_FF_Instruction instruction)
void process_sstore_instruction(SSTORE_Instruction instruction)
std::map< size_t, ProgramBlock * > internal_call_instruction_indicies_to_patch
void process_ecadd_instruction(ECADD_Instruction instruction)
void record_result_tag_from_param_tags(std::initializer_list< ParamRef > params, ResolvedAddress result_address)
void process_div_8_instruction(DIV_8_Instruction instruction)
void process_and_8_instruction(AND_8_Instruction instruction)
void process_lt_16_instruction(LT_16_Instruction instruction)
std::vector< ProgramBlock * > successors
void process_write_terminating_condition_value()
void process_sub_16_instruction(SUB_16_Instruction instruction)
void process_or_8_instruction(OR_8_Instruction instruction)
void process_cast_8_instruction(CAST_8_Instruction instruction)
void process_call_instruction(CALL_Instruction instruction)
void process_cast_16_instruction(CAST_16_Instruction instruction)
void process_not_16_instruction(NOT_16_Instruction instruction)
void process_set_64_instruction(SET_64_Instruction instruction)
void process_calldatacopy_instruction(CALLDATACOPY_Instruction instruction)
void process_successcopy_instruction(SUCCESSCOPY_Instruction instruction)
void process_l1tol2msgexists_instruction(L1TOL2MSGEXISTS_Instruction instruction)
void process_sendl2tol1msg_instruction(SENDL2TOL1MSG_Instruction instruction)
void process_mov_8_instruction(MOV_8_Instruction instruction)
std::optional< uint16_t > get_terminating_condition_value()
void process_emitunencryptedlog_instruction(EMITUNENCRYPTEDLOG_Instruction instruction)
void process_returndatasize_instruction(RETURNDATASIZE_Instruction instruction)
void process_sha256compression_instruction(SHA256COMPRESSION_Instruction instruction)
void process_instruction_block(InstructionBlock &instruction_block)
process the instruction block
void process_mul_8_instruction(MUL_8_Instruction instruction)
void process_set_16_instruction(SET_16_Instruction instruction)
void process_add_16_instruction(ADD_16_Instruction instruction)
void process_xor_8_instruction(XOR_8_Instruction instruction)
void process_eq_16_instruction(EQ_16_Instruction instruction)
void process_lte_8_instruction(LTE_8_Instruction instruction)
void process_getcontractinstance_instruction(GETCONTRACTINSTANCE_Instruction instruction)
void finalize_with_jump_if(ProgramBlock *target_then_block, ProgramBlock *target_else_block, uint16_t condition_offset, bool copy_memory_manager=true)
finalize the block with a jump if Sets the terminator type to JUMP_IF, adds the target blocks to the ...
void process_set_32_instruction(SET_32_Instruction instruction)
void process_getenvvar_instruction(GETENVVAR_Instruction instruction)
TerminatorType terminator_type
void process_lt_8_instruction(LT_8_Instruction instruction)
std::vector< bb::avm2::simulation::Instruction > instructions
void process_shr_8_instruction(SHR_8_Instruction instruction)
void process_mov_16_instruction(MOV_16_Instruction instruction)
void process_set_128_instruction(SET_128_Instruction instruction)
simulation::Instruction build() const
InstructionBuilder & relative()
InstructionBuilder & operand(OperandBuilder operand)
@ return_value_offset_index
@ contract_address_address
overloaded(Ts...) -> overloaded< Ts... >
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
unsigned __int128 uint128_t
mem[result_offset] = mem[a_address] + mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] + mem[b_address]
mem[result_offset] = mem[a_address] & mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] & mem[b_address]
CAST_16: cast mem[src_offset_index] to target_tag and store at dst_offset.
CAST_8: cast mem[src_offset_index] to target_tag and store at dst_offset.
mem[result_offset] = mem[a_address] / mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] / mem[b_address]
EMITNOTEHASH: M[note_hash_offset] = note_hash; emit note hash to the note hash tree.
EMITNULIFIER: inserts new nullifier to the nullifier tree.
mem[result_offset] = mem[a_address] == mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] == mem[b_address]
GETENVVAR: M[result_offset] = getenvvar(type)
AddressRef result_address
KECCAKF1600: Perform Keccak-f[1600] permutation on 25 U64 values M[dst_address:dst_address+25] = kecc...
L1TOL2MSGEXISTS: Check if a L1 to L2 message exists M[result_address] = L1TOL2MSGEXISTS(M[msg_hash_ad...
mem[result_offset] = mem[a_address] < mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] < mem[b_address]
mem[result_offset] = mem[a_address] <= mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] <= mem[b_address]
MOV_16 instruction: mem[dst_offset] = mem[src_offset].
MOV_8 instruction: mem[dst_offset] = mem[src_offset].
mem[result_offset] = mem[a_address] * mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] * mem[b_address]
Wrapper for MemoryTag to allow for msgpack packing and unpacking.
NULLIFIEREXISTS: checks if nullifier exists in the nullifier tree Gets contract's address by GETENVVA...
mem[result_offset] = mem[a_address] | mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] | mem[b_address]
POSEIDON2PERM: Perform Poseidon2 permutation on 4 FF values M[dst_address:dst_address+4] = poseidon2_...
Output of resolving an address in the memory manager In order to resolve a given absolute address wit...
uint32_t absolute_address
std::optional< uint32_t > pointer_address
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
SHA256COMPRESSION: Perform SHA256 compression M[dst_address:dst_address+8] = sha256_compression(M[sta...
mem[result_offset] = mem[a_address] << mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] << mem[b_address]
mem[result_offset] = mem[a_address] >> mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] >> mem[b_address]
SLOAD: M[slot_offset] = slot; M[result_offset] = S[M[slotOffset]].
SSTORE: M[slot_offset_index] = slot; S[M[slotOffset]] = M[srcOffset].
mem[result_offset] = mem[a_address] - mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] - mem[b_address]
TORADIXBE: Convert a field element to a vector of limbs in big-endian radix representation M[dst_addr...
mem[result_offset] = mem[a_address] ^ mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] ^ mem[b_address]
std::vector< FuzzInstruction > instructions