detect_vault_features

Documentation for eth_defi.erc_4626.classification.detect_vault_features function.

detect_vault_features(web3, address, verbose=True)

Detect the ERC-4626 features of a vault smart contract.

  • Protocols: Harvest, Lagoon, etc.

  • Does support ERC-7540

  • Very slow, only use in scripts and tutorials.

  • Use to pass to create_vault_instance() to get a correct Python proxy class for the vault institated.

Example:

features = detect_vault_features(web3, spec.vault_address, verbose=False)
logger.info("Detected vault features: %s", features)

vault = create_vault_instance(
    web3,
    spec.vault_address,
    features=features,
)
Parameters
Return type

set[eth_defi.erc_4626.core.ERC4626Feature]