erc_4626.scan
Documentation for eth_defi.erc_4626.scan Python module.
Turn vault discoveries to human-readable and machine-readable tables.
Module Attributes
Permission reporting is optional, but must not hide adapter programming errors. |
|
|
Compatibility alias for existing integrations. |
Functions
|
Read adapter metadata and assemble one vault catalogue row. |
|
Compatibility alias for existing integrations. |
|
Read a vault-wide account-admission policy for a scan record. |
|
Read one metadata candidate using a reusable worker connection. |
- DEPOSIT_PERMISSION_READ_EXCEPTIONS = (<class 'NotImplementedError'>, <class 'ConnectionError'>, <class 'TimeoutError'>, <class 'eth_abi.exceptions.DecodingError'>, <class 'web3.exceptions.BadFunctionCallOutput'>, <class 'web3.exceptions.ContractLogicError'>, <class 'eth_defi.provider.fallback.ExtraValueError'>, <class 'web3.exceptions.MismatchedABI'>, <class 'requests.exceptions.RequestException'>, <class 'web3.exceptions.Web3RPCError'>)
Permission reporting is optional, but must not hide adapter programming errors. Keep this deliberately narrower than BEST_EFFORT_READ_EXCEPTIONS.
- fetch_deposit_permission(vault)
Read a vault-wide account-admission policy for a scan record.
The report remains usable when a deployed adapter version lacks the protocol-specific view method or its node cannot answer a view call. It intentionally catches only concrete transport, ABI and contract-call failures: implementation bugs such as
AttributeErrorandTypeErrorpropagate to the row-level scanner guard instead of becomingunknown.- Parameters
vault (eth_defi.vault.base.VaultBase) – Protocol adapter whose vault-wide account-admission policy is queried.
- Returns
JSON-compatible enum representing account admission or an explicitly unknown status.
- Return type
- create_vault_scan_record(web3, detection, block_identifier, token_cache, metadata_snapshot=None)
Read adapter metadata and assemble one vault catalogue row.
Discovery workers and queue recovery call this at a numeric source block. It returns a record for the caller to persist rather than writing the catalogue itself. Known unsupported contracts become explicit broken rows; transport failures and programming defects must remain visible to the phase boundary. Optional raw snapshots reduce standard input reads without replacing the adapter’s protocol-specific validation or economic rules.
- Parameters
web3 (web3.main.Web3) – Worker-owned connection for the candidate’s verified chain.
detection (eth_defi.erc_4626.core.ERC4262VaultDetection) – Classified candidate, including activity and deployment data.
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]) – Source block for metadata and economic inputs.
token_cache (eth_defi.token.TokenDiskCache) – Shared token metadata cache, or None to bypass caching.
metadata_snapshot (Optional[dict]) – Optional raw standard inputs from the same block.
- Returns
Human-readable table fields and private fields prefixed with an underscore. _detection_data retains the typed candidate for catalogue persistence.
- Return type
- fetch_vault_scan_record_in_worker(web3factory, detection, block_number, metadata_snapshot=None, current_state=False)
Read one metadata candidate using a reusable worker connection.
Worker-local connections and token caches serve threaded or process callers. Explicit historical blocks stay pinned; current HyperEVM reads refresh the safe head to stay inside its short execution window.
- Parameters
web3factory (eth_defi.event_reader.web3factory.Web3Factory) – Phase-owned factory with optional request accounting.
detection (eth_defi.erc_4626.core.ERC4262VaultDetection) – Classified vault candidate.
block_number (int) – Numeric source block, preserved for historical callers.
metadata_snapshot (Optional[dict]) – Optional raw inputs at the same source block.
current_state (bool) – Permit a fresh HyperEVM head for live metadata only.
- Returns
Metadata row from
create_vault_scan_record().- Return type
- create_vault_scan_record_subprocess(web3factory, detection, block_number, metadata_snapshot=None, current_state=False)
Compatibility alias for existing integrations. Execution uses worker-local resources with either joblib backend; it does not require a subprocess.
- Parameters
web3factory (eth_defi.event_reader.web3factory.Web3Factory) –
detection (eth_defi.erc_4626.core.ERC4262VaultDetection) –
block_number (int) –
current_state (bool) –
- Return type