enzyme.blue_discovery

Documentation for eth_defi.enzyme.blue_discovery Python module.

Enzyme Blue vault discovery through persistent Dispatcher events.

An Enzyme Blue fund has two proxy contracts: the ERC-20 VaultProxy and its ComptrollerProxy accessor. Dispatcher.VaultProxyDeployed is the canonical, release-independent event that records both addresses. Querying the persistent Dispatcher, rather than each historic FundDeployer, discovers all Blue releases with one HyperSync stream per chain.

See https://docs.enzyme.finance/enzyme-blue-protocol/architecture/persistent and https://docs.enzyme.finance/enzyme-blue-protocol/architecture/release.

Module Attributes

ENZYME_BLUE_DEPLOYMENTS

Deployment constants from Enzyme's chain contract pages.

Functions

create_enzyme_blue_factory_candidate(web3, ...)

Create a Blue scanner candidate from a reviewed Dispatcher event.

decode_enzyme_blue_vault_deployed_event(log)

Decode vault, accessor, and name from a Dispatcher deployment event.

fetch_enzyme_blue_deployments_for_chain(chain_id)

Return reviewed Blue Dispatcher deployments for chain_id.

fetch_enzyme_blue_dispatchers_for_chain(chain_id)

Return persistent Blue Dispatcher addresses for chain_id.

fetch_enzyme_blue_first_block(chain_id)

Return the first supported Blue discovery block for chain_id.

fetch_enzyme_blue_vault_deployed_event_topic()

Return the Blue Dispatcher.VaultProxyDeployed topic0.

is_enzyme_blue_factory_log(chain_id, ...)

Check whether a log is an official configured Blue deployment event.

Classes

EnzymeBlueDeployment

Reviewed persistent Dispatcher deployment for a Blue chain.

EnzymeBlueVaultFactoryCandidate

A Blue fund decoded from Dispatcher.VaultProxyDeployed.

class EnzymeBlueDeployment

Bases: object

Reviewed persistent Dispatcher deployment for a Blue chain.

chain_id: int

EVM chain id.

dispatcher: eth_typing.evm.HexAddress

Persistent Dispatcher address.

first_block: int

First block at which the Dispatcher can emit fund deployment events.

__init__(chain_id, dispatcher, first_block)
Parameters
Return type

None

ENZYME_BLUE_DEPLOYMENTS: dict[int, eth_defi.enzyme.blue_discovery.EnzymeBlueDeployment] = {1: EnzymeBlueDeployment(chain_id=1, dispatcher='0xC3DC853dD716bd5754f421ef94fdCbac3902ab32', first_block=11632494), 137: EnzymeBlueDeployment(chain_id=137, dispatcher='0x2e25271297537B8124b8f883a92fFd95C4032733', first_block=25825795), 8453: EnzymeBlueDeployment(chain_id=8453, dispatcher='0xD79FCD6eb56115f9757EC4C90fc2C5D143f83C16', first_block=23178791), 42161: EnzymeBlueDeployment(chain_id=42161, dispatcher='0x8da28441a4c594fD2fac72726C1412d8Cf9E4A19', first_block=230330758)}

Deployment constants from Enzyme’s chain contract pages. The starting blocks are the first supported Blue release blocks in our existing Enzyme deployment registry; scanning begins there, but a single persistent Dispatcher yields every later release and migration.

class EnzymeBlueVaultFactoryCandidate

Bases: object

A Blue fund decoded from Dispatcher.VaultProxyDeployed.

address: eth_typing.evm.HexAddress

Canonical VaultProxy/share-token address.

dispatcher_address: eth_typing.evm.HexAddress

Persistent Dispatcher which emitted the authoritative event.

fund_deployer: eth_typing.evm.HexAddress

Release’s FundDeployer, useful for protocol-fee configuration.

vault_accessor: eth_typing.evm.HexAddress

Paired ComptrollerProxy at fund creation.

fund_name: str

Manager-supplied fund name from the deployment event.

__init__(chain, address, dispatcher_address, fund_deployer, vault_accessor, fund_name, created_block, created_at, transaction_hash, log_index)
Parameters
Return type

None

fetch_enzyme_blue_vault_deployed_event_topic()

Return the Blue Dispatcher.VaultProxyDeployed topic0.

Return type

str

fetch_enzyme_blue_deployments_for_chain(chain_id)

Return reviewed Blue Dispatcher deployments for chain_id.

Parameters

chain_id (int) –

Return type

list[eth_defi.enzyme.blue_discovery.EnzymeBlueDeployment]

fetch_enzyme_blue_dispatchers_for_chain(chain_id)

Return persistent Blue Dispatcher addresses for chain_id.

Parameters

chain_id (int) –

Return type

list[eth_typing.evm.HexAddress]

fetch_enzyme_blue_first_block(chain_id)

Return the first supported Blue discovery block for chain_id.

Parameters

chain_id (int) –

Return type

Optional[int]

decode_enzyme_blue_vault_deployed_event(log)

Decode vault, accessor, and name from a Dispatcher deployment event.

Parameters

log (Any) –

Return type

tuple[eth_typing.evm.HexAddress, eth_typing.evm.HexAddress, str]

create_enzyme_blue_factory_candidate(web3, chain_id, log, timestamp)

Create a Blue scanner candidate from a reviewed Dispatcher event.

Parameters
Return type

eth_defi.enzyme.blue_discovery.EnzymeBlueVaultFactoryCandidate

is_enzyme_blue_factory_log(chain_id, address, topic0)

Check whether a log is an official configured Blue deployment event.

Parameters
Return type

bool