24 .private_functions_root = 0,
26 .public_bytecode_commitment = bytecode_commitment,
38 .current_contract_class_id =
class_id,
39 .original_contract_class_id =
class_id,
40 .initialization_hash = 0,
44 .incoming_viewing_key = affine_one,
45 .outgoing_viewing_key = affine_one,
46 .tagging_key = affine_one,
55 auto default_class = create_default_class(
bytecode);
56 auto default_instance = create_default_instance(default_class.id);
59 contract_db_->add_contract_class(default_class.id, default_class);
65 }
catch (
const std::exception& e) {
66 std::string msg = e.what();
68 if (msg.find(
"is already present") == std::string::npos) {
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
void set_existing_contract_addresses(std::span< const FF > contract_addresses)
FF register_contract_from_bytecode(const std::vector< uint8_t > &bytecode)
Register a contract from its bytecode.
void reset()
Clear all contract addresses and reset the contract DB.
void set_existing_note_hashes(std::span< const std::pair< FF, uint64_t > > note_hashes)
std::optional< std::pair< FF, uint64_t > > get_existing_note_hash(size_t index) const
std::unique_ptr< FuzzerContractDB > contract_db_
std::vector< std::pair< FF, uint64_t > > existing_note_hashes_
std::vector< FF > contract_addresses_
static FuzzerWorldStateManager * getInstance()
void register_contract_address(const AztecAddress &contract_address)
static constexpr affine_element affine_one
AztecAddress contract_address
FF compute_public_bytecode_commitment(std::span< const uint8_t > bytecode)
FF compute_contract_class_id(const FF &artifact_hash, const FF &private_fn_root, const FF &public_bytecode_commitment)
FF compute_contract_address(const ContractInstance &contract_instance)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
AffinePoint nullifier_key