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

#include <contract_instance_manager.hpp>

Inheritance diagram for bb::avm2::simulation::ContractInstanceManager:
bb::avm2::simulation::ContractInstanceManagerInterface

Public Member Functions

 ContractInstanceManager (ContractDBInterface &contract_db, HighLevelMerkleDBInterface &merkle_db, UpdateCheckInterface &update_check, EventEmitterInterface< ContractInstanceRetrievalEvent > &event_emitter)
 
std::optional< ContractInstanceget_contract_instance (const FF &contract_address) override
 Retrieves a contract instance from the contract database.
 
- Public Member Functions inherited from bb::avm2::simulation::ContractInstanceManagerInterface
virtual ~ContractInstanceManagerInterface ()=default
 

Private Attributes

ContractDBInterfacecontract_db
 
HighLevelMerkleDBInterfacemerkle_db
 
UpdateCheckInterfaceupdate_check
 
EventEmitterInterface< ContractInstanceRetrievalEvent > & event_emitter
 

Detailed Description

Definition at line 41 of file contract_instance_manager.hpp.

Constructor & Destructor Documentation

◆ ContractInstanceManager()

bb::avm2::simulation::ContractInstanceManager::ContractInstanceManager ( ContractDBInterface contract_db,
HighLevelMerkleDBInterface merkle_db,
UpdateCheckInterface update_check,
EventEmitterInterface< ContractInstanceRetrievalEvent > &  event_emitter 
)

Definition at line 6 of file contract_instance_manager.cpp.

Member Function Documentation

◆ get_contract_instance()

std::optional< ContractInstance > bb::avm2::simulation::ContractInstanceManager::get_contract_instance ( const FF contract_address)
overridevirtual

Retrieves a contract instance from the contract database.

If the instance is found, validate that with a nullifier check, perform address derivation, and update checking. If it is NOT found, validate its NON-membership with a nullifier check, and skip the rest.

Parameters
contract_addressThe address of the contract to retrieve. Also the nullifier to check.
Returns
The contract instance if it exists, otherwise std::nullopt.
Note
Emits a ContractInstanceRetrievalEvent for this contract address at the current roots.

Implements bb::avm2::simulation::ContractInstanceManagerInterface.

Definition at line 27 of file contract_instance_manager.cpp.

Member Data Documentation

◆ contract_db

ContractDBInterface& bb::avm2::simulation::ContractInstanceManager::contract_db
private

Definition at line 51 of file contract_instance_manager.hpp.

◆ event_emitter

EventEmitterInterface<ContractInstanceRetrievalEvent>& bb::avm2::simulation::ContractInstanceManager::event_emitter
private

Definition at line 54 of file contract_instance_manager.hpp.

◆ merkle_db

HighLevelMerkleDBInterface& bb::avm2::simulation::ContractInstanceManager::merkle_db
private

Definition at line 52 of file contract_instance_manager.hpp.

◆ update_check

UpdateCheckInterface& bb::avm2::simulation::ContractInstanceManager::update_check
private

Definition at line 53 of file contract_instance_manager.hpp.


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