Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::fuzzer::FuzzerContext Class Reference

#include <fuzzer_context.hpp>

Public Member Functions

 FuzzerContext ()
 
FF register_contract_from_bytecode (const std::vector< uint8_t > &bytecode)
 Register a contract from its bytecode.
 
void add_contract_address (FF address)
 Add a contract address to the context (without registering a contract)
 
void reset ()
 Clear all contract addresses and reset the contract DB.
 
FF get_contract_address (size_t index) const
 Get a contract address by index (wraps around using modulo)
 
bool has_contracts () const
 Check if any contracts are registered.
 
size_t contract_count () const
 Get the number of registered contracts.
 
FuzzerContractDBget_contract_db () const
 Get the contract database for simulation.
 

Private Attributes

std::vector< FFcontract_addresses_
 
std::unique_ptr< FuzzerContractDBcontract_db_
 

Detailed Description

Definition at line 15 of file fuzzer_context.hpp.

Constructor & Destructor Documentation

◆ FuzzerContext()

bb::avm2::fuzzer::FuzzerContext::FuzzerContext ( )
inline

Definition at line 17 of file fuzzer_context.hpp.

Member Function Documentation

◆ add_contract_address()

void bb::avm2::fuzzer::FuzzerContext::add_contract_address ( FF  address)
inline

Add a contract address to the context (without registering a contract)

Definition at line 30 of file fuzzer_context.hpp.

◆ contract_count()

size_t bb::avm2::fuzzer::FuzzerContext::contract_count ( ) const
inline

Get the number of registered contracts.

Definition at line 51 of file fuzzer_context.hpp.

◆ get_contract_address()

FF bb::avm2::fuzzer::FuzzerContext::get_contract_address ( size_t  index) const
inline

Get a contract address by index (wraps around using modulo)

Returns
The contract address, or FF::zero() if no contracts registered

Definition at line 39 of file fuzzer_context.hpp.

◆ get_contract_db()

FuzzerContractDB & bb::avm2::fuzzer::FuzzerContext::get_contract_db ( ) const
inline

Get the contract database for simulation.

Definition at line 54 of file fuzzer_context.hpp.

◆ has_contracts()

bool bb::avm2::fuzzer::FuzzerContext::has_contracts ( ) const
inline

Check if any contracts are registered.

Definition at line 48 of file fuzzer_context.hpp.

◆ register_contract_from_bytecode()

FF bb::avm2::fuzzer::FuzzerContext::register_contract_from_bytecode ( const std::vector< uint8_t > &  bytecode)

Register a contract from its bytecode.

Parameters
bytecodeThe bytecode of the contract
Returns
The address of the registered contract
Note
This function will also register the contract address in the world state

Definition at line 51 of file fuzzer_context.cpp.

◆ reset()

void bb::avm2::fuzzer::FuzzerContext::reset ( )

Clear all contract addresses and reset the contract DB.

Definition at line 74 of file fuzzer_context.cpp.

Member Data Documentation

◆ contract_addresses_

std::vector<FF> bb::avm2::fuzzer::FuzzerContext::contract_addresses_
private

Definition at line 57 of file fuzzer_context.hpp.

◆ contract_db_

std::unique_ptr<FuzzerContractDB> bb::avm2::fuzzer::FuzzerContext::contract_db_
private

Definition at line 58 of file fuzzer_context.hpp.


The documentation for this class was generated from the following files: