#include <get_contract_instance.hpp>
Definition at line 17 of file get_contract_instance.hpp.
◆ GetContractInstance()
Construct a GetContractInstance gadget with its dependencies.
- Parameters
-
| execution_id_manager | Provides monotonic execution clock values for event ordering. |
| merkle_db | High-level Merkle database for reading tree state (roots). |
| event_emitter | Emitter for GetContractInstanceEvent used by tracegen. |
| instance_manager | Manager that retrieves (and caches) contract instances from the world state. |
Definition at line 22 of file get_contract_instance.cpp.
◆ get_contract_instance()
Retrieve a contract instance member and write the result to memory.
Validates that dst_offset+1 is in bounds and that member_enum is valid, then retrieves the contract instance via the ContractInstanceManager. Writes the existence flag (U1) to dst_offset and the selected member value (FF) to dst_offset+1.
- Parameters
-
| memory | The memory interface for the current context. |
| contract_address | The address of the contract to look up. |
| dst_offset | The memory offset at which to write the exists flag. |
| member_enum | The enum selecting which instance member to retrieve (deployer/class_id/init_hash). |
- Exceptions
-
Implements bb::avm2::simulation::GetContractInstanceInterface.
Definition at line 46 of file get_contract_instance.cpp.
◆ select_instance_member()
| FF bb::avm2::simulation::GetContractInstance::select_instance_member |
( |
const ContractInstance & |
instance, |
|
|
uint8_t |
member_enum |
|
) |
| |
|
staticprivate |
Select a contract instance member by enum value.
- Parameters
-
| instance | The contract instance to select from. |
| member_enum | The enum value identifying which member to return. |
- Returns
- The field value of the selected member.
- Exceptions
-
| std::runtime_error | If member_enum is not a valid ContractInstanceMember (should be unreachable). |
Definition at line 133 of file get_contract_instance.cpp.
◆ write_results()
| void bb::avm2::simulation::GetContractInstance::write_results |
( |
MemoryInterface & |
memory, |
|
|
MemoryAddress |
dst_offset, |
|
|
bool |
exists, |
|
|
const FF & |
member_value |
|
) |
| |
|
staticprivate |
Write the contract instance existence flag and member value to memory.
- Parameters
-
| memory | The memory interface for the current context. |
| dst_offset | The memory offset at which to write the exists flag (U1). |
| exists | Whether the contract instance was found. |
| member_value | The selected member value to write at dst_offset+1 (FF). |
Definition at line 114 of file get_contract_instance.cpp.
◆ event_emitter
◆ execution_id_manager
◆ instance_manager
◆ merkle_db
The documentation for this class was generated from the following files: