1#include <gtest/gtest.h>
21 context.register_contract_from_bytecode(function);
23 std::cout <<
"Failed to register predefined function: " << function.size() <<
std::endl;
51 const std::vector<FF>& note_hashes)
57 auto contract_address =
context.register_contract_from_bytecode(
bytecode);
61 FF fee_required_da =
FF(
tx.effective_gas_fees.fee_per_da_gas) *
FF(
tx.gas_settings.gas_limits.da_gas);
62 FF fee_required_l2 =
FF(
tx.effective_gas_fees.fee_per_l2_gas) *
FF(
tx.gas_settings.gas_limits.l2_gas);
67 auto result = cpp_simulator.simulate(*
ws_mgr,
96 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2,
instruction };
105 return result.
output.at(0);
113 auto set_instruction_1 =
117 auto set_instruction_2 =
121 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2,
instruction };
123 auto return_options =
131 return result.
output.at(0);
147 auto result = get_result_of_instruction(add_instruction);
148 EXPECT_EQ(result, 7);
158 auto result = get_result_of_instruction(sub_instruction);
159 EXPECT_EQ(result, 3);
169 auto result = get_result_of_instruction(mul_instruction);
170 EXPECT_EQ(result, 10);
180 auto result = get_result_of_instruction(div_instruction);
181 EXPECT_EQ(result, 2);
192 EXPECT_EQ(result, 0);
203 EXPECT_EQ(result, 0);
214 EXPECT_EQ(result, 0);
224 auto result = get_result_of_instruction(and_instruction);
225 EXPECT_EQ(result, 0);
235 auto result = get_result_of_instruction(or_instruction);
236 EXPECT_EQ(result, 7);
246 auto result = get_result_of_instruction(xor_instruction);
247 EXPECT_EQ(result, 7);
257 auto result = get_result_of_instruction(shl_instruction);
258 EXPECT_EQ(result, 20);
268 auto result = get_result_of_instruction(shr_instruction);
269 EXPECT_EQ(result, 1);
280 auto set_instruction_1 =
284 auto set_instruction_2 =
288 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2, fdiv_instruction };
290 auto return_options =
297 auto result = simulate_with_default_tx(
bytecode, {});
298 EXPECT_EQ(result.output.at(0), 2);
304 auto set_instruction =
312 auto instructions = std::vector<FuzzInstruction>{ set_instruction, not_instruction };
313 auto return_options =
320 auto result = simulate_with_default_tx(
bytecode, {});
321 EXPECT_EQ(result.output.at(0), 255);
336 auto result = get_result_of_instruction_16(add_instruction);
337 EXPECT_EQ(result, 7);
347 auto result = get_result_of_instruction_16(sub_instruction);
348 EXPECT_EQ(result, 3);
358 auto result = get_result_of_instruction_16(mul_instruction);
359 EXPECT_EQ(result, 10);
369 auto result = get_result_of_instruction_16(div_instruction);
370 EXPECT_EQ(result, 2);
381 EXPECT_EQ(result, 0);
392 EXPECT_EQ(result, 0);
403 EXPECT_EQ(result, 0);
413 auto result = get_result_of_instruction_16(and_instruction);
414 EXPECT_EQ(result, 0);
424 auto result = get_result_of_instruction_16(or_instruction);
425 EXPECT_EQ(result, 7);
435 auto result = get_result_of_instruction_16(xor_instruction);
436 EXPECT_EQ(result, 7);
446 auto result = get_result_of_instruction_16(shl_instruction);
447 EXPECT_EQ(result, 20);
457 auto result = get_result_of_instruction_16(shr_instruction);
458 EXPECT_EQ(result, 1);
469 auto set_instruction_1 =
473 auto set_instruction_2 =
477 auto instructions = std::vector<FuzzInstruction>{ set_instruction_1, set_instruction_2, fdiv_instruction };
479 auto return_options =
486 auto result = simulate_with_default_tx(
bytecode, {});
487 EXPECT_EQ(result.output.at(0), 2);
493 auto set_instruction =
501 auto instructions = std::vector<FuzzInstruction>{ set_instruction, not_instruction };
502 auto return_options =
509 auto result = simulate_with_default_tx(
bytecode, {});
510 EXPECT_EQ(result.output.at(0), 255);
532 auto instructions = std::vector<FuzzInstruction>{ set_u16, set_u8, cast_instruction };
533 auto return_options =
540 auto result = simulate_with_default_tx(
bytecode, {});
541 EXPECT_EQ(result.output.at(0), 2);
560 auto instructions = std::vector<FuzzInstruction>{ set_u16, set_u8, cast_instruction };
561 auto return_options =
568 auto result = simulate_with_default_tx(
bytecode, {});
569 EXPECT_EQ(result.output.at(0), 2);
577 const uint16_t test_value = 0xABCD;
578 auto set_instruction =
581 .value = test_value };
582 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
583 auto return_options =
590 auto result = simulate_with_default_tx(
bytecode, {});
591 EXPECT_EQ(result.output.at(0), test_value);
596 const uint32_t test_value = 0x12345678UL;
597 auto set_instruction =
600 .value = test_value };
601 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
602 auto return_options =
609 auto result = simulate_with_default_tx(
bytecode, {});
610 EXPECT_EQ(result.output.at(0), test_value);
616 const uint64_t test_value = 0xABCDEF0123456789ULL;
617 auto set_instruction =
620 .value = test_value };
621 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
622 auto return_options =
629 auto result = simulate_with_default_tx(
bytecode, {});
630 EXPECT_EQ(result.output.at(0), test_value);
636 const uint64_t test_value_low = 0xFEDCBA9876543210ULL;
637 const uint64_t test_value_high = 0x123456789ABCDEF0ULL;
639 (
static_cast<uint128_t>(test_value_high) << 64) |
static_cast<uint128_t>(test_value_low);
640 auto set_instruction =
643 .value_low = test_value_low,
644 .value_high = test_value_high };
645 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
648 .return_value_offset_index = 0 };
654 auto result = simulate_with_default_tx(
bytecode, {});
655 EXPECT_EQ(result.output.at(0), test_value);
662 auto set_instruction =
665 .value = test_value };
666 auto instructions = std::vector<FuzzInstruction>{ set_instruction };
667 auto return_options =
674 auto result = simulate_with_default_tx(
bytecode, {});
675 EXPECT_EQ(result.output.at(0), test_value);
681 const uint8_t test_value = 0x42;
682 const uint8_t test_value2 = 0x43;
683 auto set_instruction =
686 .value = test_value };
689 .value = test_value2 };
694 auto instructions = std::vector<FuzzInstruction>{ set_instruction, set_instruction2, mov_instruction };
695 auto return_options =
702 auto result = simulate_with_default_tx(
bytecode, {});
703 EXPECT_EQ(result.output.at(0), test_value);
709 const uint16_t test_value = 0xbabe;
710 const uint16_t test_value2 = 0xc0fe;
711 auto set_instruction =
714 .value = test_value };
715 auto set_instruction2 =
718 .value = test_value2 };
723 auto instructions = std::vector<FuzzInstruction>{ set_instruction, set_instruction2, mov_instruction };
724 auto return_options =
731 auto result = simulate_with_default_tx(
bytecode, {});
732 EXPECT_EQ(result.output.at(0), test_value);
750 .value = first_boolean_value };
754 .value = second_boolean_value };
757 for (uint8_t i = 2; i < 5; i++) {
758 auto set_instruction =
766 .return_value_offset_index = 1 };
771 .else_program_block_instruction_block_idx = 4,
772 .condition_offset_index = 0 });
774 .else_program_block_instruction_block_idx = 3,
775 .condition_offset_index = 1 });
779 return result.
output.at(0);
787 auto set_return_value_block =
792 auto instruction_block_1 =
796 .value = condition_value } } };
797 auto instruction_blocks =
801 .return_value_offset_index = 1 };
806 .else_program_block_instruction_block_idx = 2,
807 .condition_offset_index = 0 });
812 return result.
output.at(0);
821 auto block1_instructions =
826 auto block2_instructions =
832 auto return_options =
839 auto result = simulate_with_default_tx(
bytecode, {});
840 EXPECT_EQ(result.output.at(0), 11);
850 auto block1_instructions =
855 auto block2_instructions =
860 auto block3_instructions =
865 auto instruction_blocks =
867 auto return_options =
875 auto result = simulate_with_default_tx(
bytecode, {});
876 EXPECT_EQ(result.output.at(0), 12);
891 auto return_options =
898 auto result = simulate_with_default_tx(
bytecode, {});
899 EXPECT_EQ(result.output.at(0), 10);
907 auto set_true_block =
912 auto set_false_block =
917 auto block2_instructions =
922 auto block3_instructions =
927 auto instruction_blocks =
929 auto return_options =
935 .else_program_block_instruction_block_idx = 3,
936 .condition_offset_index = 1 });
937 auto bytecode_1 =
control_flow.build_bytecode(return_options);
938 auto control_flow2 =
ControlFlow(instruction_blocks);
942 .else_program_block_instruction_block_idx = 3,
943 .condition_offset_index = 1 });
944 auto bytecode_2 = control_flow2.build_bytecode(return_options);
946 auto result_1 = simulate_with_default_tx(bytecode_1, {});
947 auto result_2 = simulate_with_default_tx(bytecode_2, {});
948 EXPECT_EQ(result_1.output.at(0), 11);
949 EXPECT_EQ(result_2.output.at(0), 12);
954 EXPECT_EQ(simulate_jump_if_depth_2_helper(1, 1), 2);
955 EXPECT_EQ(simulate_jump_if_depth_2_helper(1, 0), 3);
956 EXPECT_EQ(simulate_jump_if_depth_2_helper(0, 1), 4);
957 EXPECT_EQ(simulate_jump_if_depth_2_helper(0, 0), 4);
962 EXPECT_EQ(simulate_jump_to_block_helper(1), 2);
963 EXPECT_EQ(simulate_jump_to_block_helper(0), 2);
974 auto set_condition_block =
986 .value = ff_value } } };
989 const uint64_t u128_value_low = 0xFEDCBA9876543210ULL;
990 const uint64_t u128_value_high = 0x123456789ABCDEF0ULL;
991 auto set_u128_block =
995 .value_low = u128_value_low,
996 .value_high = u128_value_high } } };
1007 .else_program_block_instruction_block_idx = 2,
1008 .condition_offset_index = 0 });
1021 auto control_flow_true =
ControlFlow(instruction_blocks);
1024 .else_program_block_instruction_block_idx = 2,
1025 .condition_offset_index = 0 });
1033 auto bytecode_true = control_flow_true.build_bytecode(
ReturnOptions{
1036 auto result_true = simulate_with_default_tx(bytecode_true, {});
1037 EXPECT_EQ(result_true.output.at(0), ff_value);
1040 auto set_condition_false_block =
1045 auto instruction_blocks_false =
1048 auto control_flow_false =
ControlFlow(instruction_blocks_false);
1051 .else_program_block_instruction_block_idx = 2,
1052 .condition_offset_index = 0 });
1061 (
static_cast<uint128_t>(u128_value_high) << 64) |
static_cast<uint128_t>(u128_value_low);
1062 auto bytecode_false = control_flow_false.build_bytecode(
ReturnOptions{
1065 auto result_false = simulate_with_default_tx(bytecode_false, {});
1066 EXPECT_EQ(result_false.output.at(0), expected_u128_value);
1074 auto set_value_instruction =
1085 auto sload_instruction =
1090 auto set_value_instruction2 =
1096 .
instructions = { set_value_instruction, sstore_instruction, sload_instruction, set_value_instruction2 }
1103 .return_value_offset_index = 1 };
1108 auto result = simulate_with_default_tx(
bytecode, {});
1109 EXPECT_EQ(result.output.at(0), 10);
1119 auto getenvvar_instruction =
1122 auto instruction_blocks =
1126 auto return_options =
1131 return result.
output.at(0);
1137 EXPECT_EQ(getenvvar_helper(0),
1138 FF(
"0x0dcd235d388105fa4154fc2d1c0143686d5da4d4aa9826d8f6609a02dc2d7c56"));
1141 EXPECT_EQ(getenvvar_helper(3),
CHAIN_ID);
1142 EXPECT_EQ(getenvvar_helper(4),
VERSION);
1147 EXPECT_EQ(getenvvar_helper(9), 0);
1148 EXPECT_EQ(getenvvar_helper(10),
1157 auto set_field_instruction =
1170 .
instructions = { set_field_instruction, emit_nullifier_instruction, nullifier_exists_instruction } } };
1175 auto result = simulate_with_default_tx(
bytecode, {});
1176 EXPECT_EQ(result.output.at(0), 1);
1181 auto set_field_instruction =
1194 .
instructions = { set_field_instruction, emit_nullifier_instruction, nullifier_exists_instruction } } };
1199 auto result = simulate_with_default_tx(
bytecode, {});
1200 EXPECT_EQ(result.output.at(0), 0);
1206 uint64_t leaf_index = 0;
1207 auto set_note_hash_instruction =
1211 auto set_leaf_index_instruction =
1214 .value = leaf_index };
1215 auto note_hash_exists_instruction =
1220 .
instructions = { set_note_hash_instruction, set_leaf_index_instruction, note_hash_exists_instruction } } };
1226 EXPECT_FALSE(result.reverted);
1227 EXPECT_EQ(result.output.at(0), 1);
1239 auto instruction_blocks =
1246 auto result = simulate_with_default_tx(
bytecode, {
FF(1337) });
1247 EXPECT_EQ(result.output.at(0), 1337);
1253 auto set_field_instruction =
1257 auto set_field_instruction2 =
1263 .
instructions = { set_field_instruction, set_field_instruction2 } } };
1266 control_flow.process_cfg_instruction(internal_call_instruction);
1269 auto result = simulate_with_default_tx(
bytecode, {});
1270 EXPECT_EQ(result.output.at(0), 313373);
1279 auto set_field_instruction =
1283 auto set_boolean_instruction =
1289 .
instructions = { set_field_instruction, set_boolean_instruction } } };
1292 control_flow.process_cfg_instruction(internal_call_instruction);
1300 auto result = simulate_with_default_tx(
bytecode, {});
1301 EXPECT_EQ(result.output.at(0), 1337);
1309 auto set_field_instruction =
1313 auto set_field_instruction2 =
1317 auto set_field_instruction3 =
1324 .
instructions = { set_field_instruction, set_field_instruction2, set_field_instruction3 } } };
1327 control_flow.process_cfg_instruction(internal_call_instruction);
1328 control_flow.process_cfg_instruction(internal_call_instruction2);
1331 auto result = simulate_with_default_tx(
bytecode, {});
1332 EXPECT_EQ(result.output.at(0), 313373);
1354 auto set_field_instruction0 =
1358 auto set_field_instruction1 =
1362 auto set_field_instruction2 =
1366 auto set_field_instruction3 =
1374 { set_field_instruction0, set_field_instruction1, set_field_instruction2, set_field_instruction3 } } };
1378 control_flow.process_cfg_instruction(internal_call_instruction);
1380 control_flow.process_cfg_instruction(internal_call_instruction2);
1392 control_flow.process_cfg_instruction(internal_call_instruction3);
1399 auto result = simulate_with_default_tx(
bytecode, {});
1400 EXPECT_EQ(result.output.at(0), 313373);
1407 auto set_field_instruction =
1411 auto set_field_instruction2 =
1418 .pointer_address_seed = 100,
1424 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction } } };
1429 auto result = simulate_with_default_tx(
bytecode, {});
1430 EXPECT_EQ(result.output.at(0), 30);
1435 auto set_field_instruction =
1439 auto set_field_instruction2 =
1446 .pointer_address_seed = 100,
1452 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction }, .base_offset = 100 } };
1457 auto result = simulate_with_default_tx(
bytecode, {});
1458 EXPECT_EQ(result.output.at(0), 30);
1463 auto set_field_instruction =
1478 .
instructions = { set_field_instruction, add_instruction, mul_instruction } } };
1483 auto result = simulate_with_default_tx(
bytecode, {});
1484 EXPECT_EQ(result.output.at(0), 400);
1489 auto set_field_instruction =
1495 .pointer_address_seed = 100,
1502 .pointer_address_seed = 200,
1507 .
instructions = { set_field_instruction, set_field_instruction2, add_instruction } } };
1512 auto result = simulate_with_default_tx(
bytecode, {});
1513 EXPECT_EQ(result.output.at(0), 200);
1521 auto sendl2tol1msg_instruction =
1526 auto instruction_blocks =
1532 auto result = simulate_with_default_tx(
bytecode, {});
1533 EXPECT_EQ(result.reverted,
false);
1540 uint32_t log_size = 1;
1543 std::vector<FuzzInstruction> instructions;
1551 instructions.push_back(
1559 auto result = simulate_with_default_tx(
bytecode, {});
1560 EXPECT_EQ(result.reverted,
false);
1571 std::vector<FuzzInstruction> instructions;
1572 instructions.push_back(
1587 return result.
output.at(0);
1595 std::vector<FuzzInstruction> instructions;
1596 auto contract_address =
context.get_contract_address(0);
1603 instructions.push_back(
1608 instructions.push_back(
1611 uint16_t arg_size = 0;
1618 .calldata_address = args_address,
1619 .calldata_size_address = arg_size_address,
1620 .calldata_size = arg_size,
1621 .is_static_call =
false });
1623 instructions.push_back(RETURNDATASIZE_WITH_RETURNDATACOPY_Instruction{
1624 .copy_size_offset = 6, .dst_address = 7, .rd_start = 0, .rd_start_offset = 8 });
1631 auto result = simulate_with_default_tx(
bytecode, {});
1632 EXPECT_EQ(result.output.at(0), 2);
1638 EXPECT_EQ(get_contract_instance_helper(0),
1639 FF(
"0x0000000000000000000000000000000000000000000000000000000000000064"));
1640 EXPECT_EQ(get_contract_instance_helper(1),
1641 FF(
"0x0dc97dd1cc90c276ca76f34abb5085e1ae3addd8ace763a5da908bacf147d972"));
1642 EXPECT_EQ(get_contract_instance_helper(2),
1643 FF(
"0x0000000000000000000000000000000000000000000000000000000000000000"));
1650 std::vector<FuzzInstruction> instructions;
1651 auto contract_address =
context.get_contract_address(0);
1658 instructions.push_back(
1663 instructions.push_back(
1666 uint16_t arg_size = 0;
1673 .calldata_address = args_address,
1674 .calldata_size_address = arg_size_address,
1675 .calldata_size = arg_size,
1676 .is_static_call =
false });
1678 instructions.push_back(
1686 auto result = simulate_with_default_tx(
bytecode, {});
1687 EXPECT_EQ(result.output.at(0),
FF::one());
1694 std::vector<FuzzInstruction> instructions;
1695 auto contract_address =
context.get_contract_address(1);
1702 instructions.push_back(
1707 instructions.push_back(
1710 uint16_t arg_size = 0;
1717 .calldata_address = args_address,
1718 .calldata_size_address = arg_size_address,
1719 .calldata_size = arg_size,
1720 .is_static_call =
true });
1721 instructions.push_back(
1728 auto result = simulate_with_default_tx(
bytecode, {});
1729 EXPECT_EQ(result.output.at(0),
FF::zero());
1730 EXPECT_EQ(result.reverted,
false);
1736 std::vector<FuzzInstruction> instructions;
1737 auto contract_address =
context.get_contract_address(2);
1744 instructions.push_back(
1749 instructions.push_back(
1752 uint16_t arg_size = 0;
1759 .calldata_address = args_address,
1760 .calldata_size_address = arg_size_address,
1761 .calldata_size = arg_size,
1762 .is_static_call =
true });
1763 instructions.push_back(
1770 auto result = simulate_with_default_tx(
bytecode, {});
1771 EXPECT_EQ(result.output.at(0),
FF::zero());
1772 EXPECT_EQ(result.reverted,
false);
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
FuzzerWorldStateManager * ws_mgr
void register_functions(FuzzerContext &context)
std::variant< ADD_8_Instruction, FDIV_8_Instruction, SET_8_Instruction, SET_16_Instruction, SET_32_Instruction, SET_64_Instruction, SET_128_Instruction, SET_FF_Instruction, MOV_8_Instruction, MOV_16_Instruction, SUB_8_Instruction, MUL_8_Instruction, DIV_8_Instruction, EQ_8_Instruction, LT_8_Instruction, LTE_8_Instruction, AND_8_Instruction, OR_8_Instruction, XOR_8_Instruction, SHL_8_Instruction, SHR_8_Instruction, NOT_8_Instruction, ADD_16_Instruction, SUB_16_Instruction, MUL_16_Instruction, DIV_16_Instruction, FDIV_16_Instruction, EQ_16_Instruction, LT_16_Instruction, LTE_16_Instruction, AND_16_Instruction, OR_16_Instruction, XOR_16_Instruction, NOT_16_Instruction, SHL_16_Instruction, SHR_16_Instruction, CAST_8_Instruction, CAST_16_Instruction, SSTORE_Instruction, SLOAD_Instruction, GETENVVAR_Instruction, EMITNULLIFIER_Instruction, NULLIFIEREXISTS_Instruction, L1TOL2MSGEXISTS_Instruction, EMITNOTEHASH_Instruction, NOTEHASHEXISTS_Instruction, CALLDATACOPY_Instruction, SENDL2TOL1MSG_Instruction, EMITPUBLICLOG_Instruction, CALL_Instruction, RETURNDATASIZE_Instruction, RETURNDATACOPY_Instruction, GETCONTRACTINSTANCE_Instruction, SUCCESSCOPY_Instruction, ECADD_Instruction, POSEIDON2PERM_Instruction, KECCAKF1600_Instruction, SHA256COMPRESSION_Instruction, TORADIXBE_Instruction, DEBUGLOG_Instruction > FuzzInstruction
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 a siloed nullifier exists in the nullifier tree M[result_address] = NULLIF...
mem[result_offset] = mem[a_address] | mem[b_address] (16-bit)
mem[result_offset] = mem[a_address] | mem[b_address]
ParamRef recipient_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()