1#include <gtest/gtest.h>
22 context.register_contract_from_bytecode(function);
24 std::cout <<
"Failed to register predefined function: " << function.size() <<
std::endl;
52 const std::vector<FF>& note_hashes)
62 FF fee_required_da =
FF(
tx.effective_gas_fees.fee_per_da_gas) *
FF(
tx.gas_settings.gas_limits.da_gas);
63 FF fee_required_l2 =
FF(
tx.effective_gas_fees.fee_per_l2_gas) *
FF(
tx.gas_settings.gas_limits.l2_gas);
68 auto result = cpp_simulator.simulate(*
ws_mgr,
97 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2,
instruction };
106 return result.
output.at(0);
114 auto set_instruction_1 =
118 auto set_instruction_2 =
122 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2,
instruction };
124 auto return_options =
132 return result.
output.at(0);
148 auto result = get_result_of_instruction(add_instruction);
149 EXPECT_EQ(result, 7);
159 auto result = get_result_of_instruction(sub_instruction);
160 EXPECT_EQ(result, 3);
170 auto result = get_result_of_instruction(mul_instruction);
171 EXPECT_EQ(result, 10);
181 auto result = get_result_of_instruction(div_instruction);
182 EXPECT_EQ(result, 2);
193 EXPECT_EQ(result, 0);
204 EXPECT_EQ(result, 0);
215 EXPECT_EQ(result, 0);
225 auto result = get_result_of_instruction(and_instruction);
226 EXPECT_EQ(result, 0);
236 auto result = get_result_of_instruction(or_instruction);
237 EXPECT_EQ(result, 7);
247 auto result = get_result_of_instruction(xor_instruction);
248 EXPECT_EQ(result, 7);
258 auto result = get_result_of_instruction(shl_instruction);
259 EXPECT_EQ(result, 20);
269 auto result = get_result_of_instruction(shr_instruction);
270 EXPECT_EQ(result, 1);
281 auto set_instruction_1 =
285 auto set_instruction_2 =
289 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2, fdiv_instruction };
291 auto return_options =
298 auto result = simulate_with_default_tx(
bytecode, {});
299 EXPECT_EQ(result.output.at(0), 2);
305 auto set_instruction =
313 auto instructions = std::vector<FuzzInstruction>{ set_instruction, not_instruction };
314 auto return_options =
321 auto result = simulate_with_default_tx(
bytecode, {});
322 EXPECT_EQ(result.output.at(0), 255);
337 auto result = get_result_of_instruction_16(add_instruction);
338 EXPECT_EQ(result, 7);
348 auto result = get_result_of_instruction_16(sub_instruction);
349 EXPECT_EQ(result, 3);
359 auto result = get_result_of_instruction_16(mul_instruction);
360 EXPECT_EQ(result, 10);
370 auto result = get_result_of_instruction_16(div_instruction);
371 EXPECT_EQ(result, 2);
382 EXPECT_EQ(result, 0);
393 EXPECT_EQ(result, 0);
404 EXPECT_EQ(result, 0);
414 auto result = get_result_of_instruction_16(and_instruction);
415 EXPECT_EQ(result, 0);
425 auto result = get_result_of_instruction_16(or_instruction);
426 EXPECT_EQ(result, 7);
436 auto result = get_result_of_instruction_16(xor_instruction);
437 EXPECT_EQ(result, 7);
447 auto result = get_result_of_instruction_16(shl_instruction);
448 EXPECT_EQ(result, 20);
458 auto result = get_result_of_instruction_16(shr_instruction);
459 EXPECT_EQ(result, 1);
470 auto set_instruction_1 =
474 auto set_instruction_2 =
478 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2, fdiv_instruction };
480 auto return_options =
487 auto result = simulate_with_default_tx(
bytecode, {});
488 EXPECT_EQ(result.output.at(0), 2);
494 auto set_instruction =
502 auto instructions = std::vector<FuzzInstruction>{ set_instruction, not_instruction };
503 auto return_options =
510 auto result = simulate_with_default_tx(
bytecode, {});
511 EXPECT_EQ(result.output.at(0), 255);
533 auto instructions = std::vector<FuzzInstruction>{ set_u16, set_u8, cast_instruction };
534 auto return_options =
541 auto result = simulate_with_default_tx(
bytecode, {});
542 EXPECT_EQ(result.output.at(0), 2);
561 auto instructions = std::vector<FuzzInstruction>{ set_u16, set_u8, cast_instruction };
562 auto return_options =
569 auto result = simulate_with_default_tx(
bytecode, {});
570 EXPECT_EQ(result.output.at(0), 2);
578 const uint16_t test_value = 0xABCD;
579 auto set_instruction =
582 .value = test_value };
583 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
584 auto return_options =
591 auto result = simulate_with_default_tx(
bytecode, {});
592 EXPECT_EQ(result.output.at(0), test_value);
597 const uint32_t test_value = 0x12345678UL;
598 auto set_instruction =
601 .value = test_value };
602 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
603 auto return_options =
610 auto result = simulate_with_default_tx(
bytecode, {});
611 EXPECT_EQ(result.output.at(0), test_value);
617 const uint64_t test_value = 0xABCDEF0123456789ULL;
618 auto set_instruction =
621 .value = test_value };
622 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
623 auto return_options =
630 auto result = simulate_with_default_tx(
bytecode, {});
631 EXPECT_EQ(result.output.at(0), test_value);
637 const uint64_t test_value_low = 0xFEDCBA9876543210ULL;
638 const uint64_t test_value_high = 0x123456789ABCDEF0ULL;
640 (
static_cast<uint128_t>(test_value_high) << 64) |
static_cast<uint128_t>(test_value_low);
641 auto set_instruction =
644 .value_low = test_value_low,
645 .value_high = test_value_high };
646 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
649 .return_value_offset_index = 0 };
655 auto result = simulate_with_default_tx(
bytecode, {});
656 EXPECT_EQ(result.output.at(0), test_value);
663 auto set_instruction =
666 .value = test_value };
667 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
668 auto return_options =
675 auto result = simulate_with_default_tx(
bytecode, {});
676 EXPECT_EQ(result.output.at(0), test_value);
682 const uint8_t test_value = 0x42;
683 const uint8_t test_value2 = 0x43;
684 auto set_instruction =
687 .value = test_value };
690 .value = test_value2 };
695 auto instructions = std::vector<FuzzInstruction>{ set_instruction, set_instruction2, mov_instruction };
696 auto return_options =
703 auto result = simulate_with_default_tx(
bytecode, {});
704 EXPECT_EQ(result.output.at(0), test_value);
710 const uint16_t test_value = 0xbabe;
711 const uint16_t test_value2 = 0xc0fe;
712 auto set_instruction =
715 .value = test_value };
716 auto set_instruction2 =
719 .value = test_value2 };
724 auto instructions = std::vector<FuzzInstruction>{ set_instruction, set_instruction2, mov_instruction };
725 auto return_options =
732 auto result = simulate_with_default_tx(
bytecode, {});
733 EXPECT_EQ(result.output.at(0), test_value);
751 .value = first_boolean_value };
755 .value = second_boolean_value };
758 for (uint8_t i = 2; i < 5; i++) {
759 auto set_instruction =
767 .return_value_offset_index = 1 };
772 .else_program_block_instruction_block_idx = 4,
773 .condition_offset_index = 0 });
775 .else_program_block_instruction_block_idx = 3,
776 .condition_offset_index = 1 });
780 return result.
output.at(0);
788 auto set_return_value_block =
793 auto instruction_block_1 =
797 .value = condition_value } } };
798 auto instruction_blocks =
802 .return_value_offset_index = 1 };
807 .else_program_block_instruction_block_idx = 2,
808 .condition_offset_index = 0 });
813 return result.
output.at(0);
822 auto block1_instructions =
827 auto block2_instructions =
833 auto return_options =
840 auto result = simulate_with_default_tx(
bytecode, {});
841 EXPECT_EQ(result.output.at(0), 11);
851 auto block1_instructions =
856 auto block2_instructions =
861 auto block3_instructions =
866 auto instruction_blocks =
868 auto return_options =
876 auto result = simulate_with_default_tx(
bytecode, {});
877 EXPECT_EQ(result.output.at(0), 12);
892 auto return_options =
899 auto result = simulate_with_default_tx(
bytecode, {});
900 EXPECT_EQ(result.output.at(0), 10);
908 auto set_true_block =
913 auto set_false_block =
918 auto block2_instructions =
923 auto block3_instructions =
928 auto instruction_blocks =
930 auto return_options =
936 .else_program_block_instruction_block_idx = 3,
937 .condition_offset_index = 1 });
938 auto bytecode_1 =
control_flow.build_bytecode(return_options);
939 auto control_flow2 =
ControlFlow(instruction_blocks);
943 .else_program_block_instruction_block_idx = 3,
944 .condition_offset_index = 1 });
945 auto bytecode_2 = control_flow2.build_bytecode(return_options);
947 auto result_1 = simulate_with_default_tx(bytecode_1, {});
948 auto result_2 = simulate_with_default_tx(bytecode_2, {});
949 EXPECT_EQ(result_1.output.at(0), 11);
950 EXPECT_EQ(result_2.output.at(0), 12);
955 EXPECT_EQ(simulate_jump_if_depth_2_helper(1, 1), 2);
956 EXPECT_EQ(simulate_jump_if_depth_2_helper(1, 0), 3);
957 EXPECT_EQ(simulate_jump_if_depth_2_helper(0, 1), 4);
958 EXPECT_EQ(simulate_jump_if_depth_2_helper(0, 0), 4);
963 EXPECT_EQ(simulate_jump_to_block_helper(1), 2);
964 EXPECT_EQ(simulate_jump_to_block_helper(0), 2);
975 auto set_condition_block =
987 .value = ff_value } } };
990 const uint64_t u128_value_low = 0xFEDCBA9876543210ULL;
991 const uint64_t u128_value_high = 0x123456789ABCDEF0ULL;
992 auto set_u128_block =
996 .value_low = u128_value_low,
997 .value_high = u128_value_high } } };
1008 .else_program_block_instruction_block_idx = 2,
1009 .condition_offset_index = 0 });
1022 auto control_flow_true =
ControlFlow(instruction_blocks);
1025 .else_program_block_instruction_block_idx = 2,
1026 .condition_offset_index = 0 });
1034 auto bytecode_true = control_flow_true.build_bytecode(
ReturnOptions{
1037 auto result_true = simulate_with_default_tx(bytecode_true, {});
1038 EXPECT_EQ(result_true.output.at(0), ff_value);
1041 auto set_condition_false_block =
1046 auto instruction_blocks_false =
1049 auto control_flow_false =
ControlFlow(instruction_blocks_false);
1052 .else_program_block_instruction_block_idx = 2,
1053 .condition_offset_index = 0 });
1062 (
static_cast<uint128_t>(u128_value_high) << 64) |
static_cast<uint128_t>(u128_value_low);
1063 auto bytecode_false = control_flow_false.build_bytecode(
ReturnOptions{
1066 auto result_false = simulate_with_default_tx(bytecode_false, {});
1067 EXPECT_EQ(result_false.output.at(0), expected_u128_value);
1075 auto set_value_instruction =
1086 auto sload_instruction =
1091 auto set_value_instruction2 =
1097 .
instructions = { set_value_instruction, sstore_instruction, sload_instruction, set_value_instruction2 }
1104 .return_value_offset_index = 1 };
1109 auto result = simulate_with_default_tx(
bytecode, {});
1110 EXPECT_EQ(result.output.at(0), 10);
1120 auto getenvvar_instruction =
1123 auto instruction_blocks =
1127 auto return_options =
1132 return result.
output.at(0);
1138 EXPECT_EQ(getenvvar_helper(0),
1139 FF(
"0x0dcd235d388105fa4154fc2d1c0143686d5da4d4aa9826d8f6609a02dc2d7c56"));
1142 EXPECT_EQ(getenvvar_helper(3),
CHAIN_ID);
1143 EXPECT_EQ(getenvvar_helper(4),
VERSION);
1148 EXPECT_EQ(getenvvar_helper(9), 0);
1149 EXPECT_EQ(getenvvar_helper(10),
1158 auto set_field_instruction =
1171 .
instructions = { set_field_instruction, emit_nullifier_instruction, nullifier_exists_instruction } } };
1176 auto result = simulate_with_default_tx(
bytecode, {});
1177 EXPECT_EQ(result.output.at(0), 1);
1182 auto set_field_instruction =
1195 .
instructions = { set_field_instruction, emit_nullifier_instruction, nullifier_exists_instruction } } };
1200 auto result = simulate_with_default_tx(
bytecode, {});
1201 EXPECT_EQ(result.output.at(0), 0);
1207 uint64_t leaf_index = 0;
1208 auto set_note_hash_instruction =
1212 auto set_leaf_index_instruction =
1215 .value = leaf_index };
1216 auto note_hash_exists_instruction =
1221 .
instructions = { set_note_hash_instruction, set_leaf_index_instruction, note_hash_exists_instruction } } };
1227 EXPECT_FALSE(result.reverted);
1228 EXPECT_EQ(result.output.at(0), 1);
1240 auto instruction_blocks =
1247 auto result = simulate_with_default_tx(
bytecode, {
FF(1337) });
1248 EXPECT_EQ(result.output.at(0), 1337);
1254 auto set_field_instruction =
1258 auto set_field_instruction2 =
1264 .
instructions = { set_field_instruction, set_field_instruction2 } } };
1267 control_flow.process_cfg_instruction(internal_call_instruction);
1270 auto result = simulate_with_default_tx(
bytecode, {});
1271 EXPECT_EQ(result.output.at(0), 313373);
1280 auto set_field_instruction =
1284 auto set_boolean_instruction =
1290 .
instructions = { set_field_instruction, set_boolean_instruction } } };
1293 control_flow.process_cfg_instruction(internal_call_instruction);
1301 auto result = simulate_with_default_tx(
bytecode, {});
1302 EXPECT_EQ(result.output.at(0), 1337);
1310 auto set_field_instruction =
1314 auto set_field_instruction2 =
1318 auto set_field_instruction3 =
1325 .
instructions = { set_field_instruction, set_field_instruction2, set_field_instruction3 } } };
1328 control_flow.process_cfg_instruction(internal_call_instruction);
1329 control_flow.process_cfg_instruction(internal_call_instruction2);
1332 auto result = simulate_with_default_tx(
bytecode, {});
1333 EXPECT_EQ(result.output.at(0), 313373);
1355 auto set_field_instruction0 =
1359 auto set_field_instruction1 =
1363 auto set_field_instruction2 =
1367 auto set_field_instruction3 =
1375 { set_field_instruction0, set_field_instruction1, set_field_instruction2, set_field_instruction3 } } };
1379 control_flow.process_cfg_instruction(internal_call_instruction);
1381 control_flow.process_cfg_instruction(internal_call_instruction2);
1393 control_flow.process_cfg_instruction(internal_call_instruction3);
1400 auto result = simulate_with_default_tx(
bytecode, {});
1401 EXPECT_EQ(result.output.at(0), 313373);
1408 auto set_field_instruction =
1412 auto set_field_instruction2 =
1419 .pointer_address_seed = 100,
1425 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction } } };
1430 auto result = simulate_with_default_tx(
bytecode, {});
1431 EXPECT_EQ(result.output.at(0), 30);
1436 auto set_field_instruction =
1440 auto set_field_instruction2 =
1447 .pointer_address_seed = 100,
1453 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction }, .base_offset = 100 } };
1458 auto result = simulate_with_default_tx(
bytecode, {});
1459 EXPECT_EQ(result.output.at(0), 30);
1464 auto set_field_instruction =
1479 .
instructions = { set_field_instruction, add_instruction, mul_instruction } } };
1484 auto result = simulate_with_default_tx(
bytecode, {});
1485 EXPECT_EQ(result.output.at(0), 400);
1490 auto set_field_instruction =
1496 .pointer_address_seed = 100,
1503 .pointer_address_seed = 200,
1508 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction } } };
1513 auto result = simulate_with_default_tx(
bytecode, {});
1514 EXPECT_EQ(result.output.at(0), 200);
1522 auto sendl2tol1msg_instruction =
1527 auto instruction_blocks =
1533 auto result = simulate_with_default_tx(
bytecode, {});
1534 EXPECT_EQ(result.reverted,
false);
1541 uint32_t log_size = 1;
1544 std::vector<FuzzInstruction> instructions;
1560 auto result = simulate_with_default_tx(
bytecode, {});
1561 EXPECT_EQ(result.reverted,
false);
1572 std::vector<FuzzInstruction> instructions;
1573 instructions.push_back(
1588 return result.
output.at(0);
1596 std::vector<FuzzInstruction> instructions;
1604 instructions.push_back(
1609 instructions.push_back(
1612 uint16_t arg_size = 0;
1619 .calldata_address = args_address,
1620 .calldata_size_address = arg_size_address,
1621 .calldata_size = arg_size,
1622 .is_static_call =
false });
1624 instructions.push_back(RETURNDATASIZE_WITH_RETURNDATACOPY_Instruction{
1625 .copy_size_offset = 6, .dst_address = 7, .rd_start = 0, .rd_start_offset = 8 });
1632 auto result = simulate_with_default_tx(
bytecode, {});
1633 EXPECT_EQ(result.output.at(0), 2);
1639 EXPECT_EQ(get_contract_instance_helper(0),
1640 FF(
"0x0000000000000000000000000000000000000000000000000000000000000064"));
1641 EXPECT_EQ(get_contract_instance_helper(1),
1642 FF(
"0x0dc97dd1cc90c276ca76f34abb5085e1ae3addd8ace763a5da908bacf147d972"));
1643 EXPECT_EQ(get_contract_instance_helper(2),
1644 FF(
"0x0000000000000000000000000000000000000000000000000000000000000000"));
1651 std::vector<FuzzInstruction> instructions;
1659 instructions.push_back(
1664 instructions.push_back(
1667 uint16_t arg_size = 0;
1674 .calldata_address = args_address,
1675 .calldata_size_address = arg_size_address,
1676 .calldata_size = arg_size,
1677 .is_static_call =
false });
1679 instructions.push_back(
1687 auto result = simulate_with_default_tx(
bytecode, {});
1688 EXPECT_EQ(result.output.at(0),
FF::one());
1695 std::vector<FuzzInstruction> instructions;
1703 instructions.push_back(
1708 instructions.push_back(
1711 uint16_t arg_size = 0;
1718 .calldata_address = args_address,
1719 .calldata_size_address = arg_size_address,
1720 .calldata_size = arg_size,
1721 .is_static_call =
true });
1722 instructions.push_back(
1729 auto result = simulate_with_default_tx(
bytecode, {});
1730 EXPECT_EQ(result.output.at(0),
FF::zero());
1731 EXPECT_EQ(result.reverted,
false);
1737 std::vector<FuzzInstruction> instructions;
1745 instructions.push_back(
1750 instructions.push_back(
1753 uint16_t arg_size = 0;
1760 .calldata_address = args_address,
1761 .calldata_size_address = arg_size_address,
1762 .calldata_size = arg_size,
1763 .is_static_call =
true });
1764 instructions.push_back(
1771 auto result = simulate_with_default_tx(
bytecode, {});
1772 EXPECT_EQ(result.output.at(0),
FF::zero());
1773 EXPECT_EQ(result.reverted,
false);
::FuzzInstruction FuzzInstruction
const uint32_t BLOCK_NUMBER
const std::vector< std::vector< uint8_t > > PREDEFINED_FUNCTIONS
constexpr uint128_t FEE_PER_DA_GAS
const bool IS_STATIC_CALL
constexpr uint128_t FEE_PER_L2_GAS
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
#define AVM_SET_BASE_L2_GAS
StrictMock< MockContractDB > contract_db
uses barretenberg/vm2 to simulate the bytecode
SimulatorResult simulate_with_default_tx(std::vector< uint8_t > &bytecode, std::vector< FF > calldata, const std::vector< FF > ¬e_hashes)
SimulatorResult simulate_with_default_tx(std::vector< uint8_t > &bytecode, std::vector< FF > calldata)
FF get_result_of_instruction_16(FuzzInstruction instruction, bb::avm2::MemoryTag return_value_tag=bb::avm2::MemoryTag::U8)
FF get_result_of_instruction(FuzzInstruction instruction, bb::avm2::MemoryTag return_value_tag=bb::avm2::MemoryTag::U8)
static FuzzerWorldStateManager * getInstance()
world_state::WorldStateRevision fork()
void append_note_hashes(const std::vector< FF > ¬e_hashes)
void write_fee_payer_balance(const AztecAddress &fee_payer, const FF &balance)
FF simulate_jump_if_depth_2_helper(uint8_t first_boolean_value, uint8_t second_boolean_value)
FF simulate_jump_to_block_helper(uint8_t condition_value)
FF getenvvar_helper(uint8_t type, bb::avm2::MemoryTag return_value_tag=bb::avm2::MemoryTag::FF)
FF get_contract_instance_helper(uint8_t member_enum, bb::avm2::MemoryTag return_value_tag=bb::avm2::MemoryTag::FF)
@ contract_address_address
AztecAddress contract_address
FuzzerWorldStateManager * ws_mgr
void register_functions(FuzzerContext &context)
TEST_F(ArithmeticFuzzTest, ADD8)
TEST_F(FuzzTest, DirectWithIndirect)
TEST_F(FuzzTest, CopyCalldataThenReturnData)
TEST_F(ControlFlowFuzzTest, JumpToNewBlockSmoke)
TEST_F(ExecutionEnvironmentFuzzTest, GetEnvVarSmoke)
TEST_F(ExternalCallsFuzzTest, ExternalCallToAdd8)
TEST_F(FuzzTest, InternalCalledBlockUsesInternalReturn)
TEST_F(FuzzTest, SendL2ToL1Msg)
TEST_F(FuzzTest, EmitNullifierThenNullifierExists)
TEST_F(FuzzTest, SstoreThenSload)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
unsigned __int128 uint128_t
Tx create_default_tx(const AztecAddress &contract_address, const AztecAddress &sender_address, const std::vector< FF > &calldata, const FF &transaction_fee, bool is_static_call, const Gas &gas_limit)
GlobalVariables create_default_globals()
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]
EMITNULIFIER: inserts new nullifier to the nullifier tree.
ParamRef nullifier_address
ParamRef log_size_address
mem[result_offset] = mem[a_address] == mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] == mem[b_address]
finalizes the current block with Return and switches to the first non-terminated block
ReturnOptions return_options
ParamRef contract_address_address
GETENVVAR: M[result_offset] = getenvvar(type)
AddressRef result_address
inserts INTERNALCALL instruction to the current block creates a new block and sets it as the current ...
uint16_t target_program_block_instruction_block_idx
insert instruction block to the current block
uint16_t instruction_block_idx
finalizes the current block with jump if, creates two new blocks, sets the first as the then block an...
uint16_t then_program_block_instruction_block_idx
finalizes the current block with a jump to the block, which does not create a loop in the graph (defi...
uint16_t target_block_idx
finalizes the current block with jump, creates a new block and sets it as the current block
uint16_t target_program_block_instruction_block_idx
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]
ParamRef notehash_address
NULLIFIEREXISTS: checks if nullifier exists in the nullifier tree Gets contract's address by GETENVVA...
ParamRef nullifier_address
mem[result_offset] = mem[a_address] | mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] | mem[b_address]
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
MemoryTagWrapper value_tag
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]
mem[result_offset] = mem[a_address] ^ mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] ^ mem[b_address]
std::vector< FuzzInstruction > instructions
static constexpr field one()
static constexpr field zero()