#include <contract_instance_manager.hpp>
◆ ContractInstanceManager()
Construct a ContractInstanceManager.
- Parameters
-
| contract_db | The contract database for retrieving contract instances. |
| merkle_db | The merkle database for nullifier existence checks and tree state. |
| update_check | The update check interface for validating current class IDs. |
| ff_gt | The field greater-than comparator for protocol contract range checks. |
| protocol_contracts | The set of known protocol contract addresses. |
| event_emitter | The event emitter for contract instance retrieval events. |
Definition at line 18 of file contract_instance_manager.cpp.
◆ get_contract_instance()
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_address | The address of the contract to retrieve. Also the nullifier to check. |
- Returns
- The contract instance if it exists, otherwise std::nullopt.
- Exceptions
-
| std::runtime_error | If derived address presence is inconsistent with instance presence (protocol contracts). |
| std::runtime_error | If instance is not found but nullifier exists (non-protocol contracts). |
- Note
- Asserts that derived_address.has_value() == maybe_instance.has_value() for protocol contracts.
-
Asserts that the contract instance is found when the nullifier exists.
-
Emits a ContractInstanceRetrievalEvent for this contract address at the current roots.
Implements bb::avm2::simulation::ContractInstanceManagerInterface.
Definition at line 48 of file contract_instance_manager.cpp.
◆ contract_db
◆ event_emitter
◆ ff_gt
◆ merkle_db
◆ protocol_contracts
| const ProtocolContracts& bb::avm2::simulation::ContractInstanceManager::protocol_contracts |
|
private |
◆ update_check
The documentation for this class was generated from the following files: