WhitelistingRequired

Documentation for eth_defi.vault.deposit_redeem.WhitelistingRequired exception.

exception WhitelistingRequired

Bases: eth_defi.vault.deposit_redeem.VaultFlowUnavailable

A deposit was attempted for a vault whose whitelist excludes the owner.

Raised during deposit preflight when a vault applies a deposit whitelist (permissioned) policy, that policy is applicable and queryable, and the depositing account is not a member of it. The account must be whitelisted by the vault curator before a deposit can succeed.

This is a subclass of VaultFlowUnavailable so existing callers that catch the base preflight failure keep working, while callers that want to react specifically to a missing whitelist entry — for example to surface a “whitelisting required” state instead of a generic failure — can catch this narrower type.

Message contract for diagnostics: whenever this exception is raised, its reason message (the first positional argument, i.e. the text returned by str(exc) before the structured context) must identify the failing deposit unambiguously by including all three of:

  • the chain id the vault is deployed on (chain_id()),

  • the vault contract address (address()), and

  • the depositor address that was denied (the request owner/caller).

These three values must be embedded in the message string itself — not only passed through the vault_address and caller structured fields — so a single logged message line is self-describing for diagnostics without the reader having to reconstruct the failing vault or account from surrounding context. Include the structured vault_address and caller fields as well. VaultDepositManager.check_deposit_whitelist() produces a compliant message; adapters that raise this directly must do the same.

Contract for adapter authors: every deposit manager must raise this from its deposit preflight when the vault’s whitelist policy can be determined, is applicable, and the owner is not permitted. Use VaultDepositManager.check_deposit_whitelist() to satisfy the contract. When the policy cannot be determined (the adapter’s whitelist reads raise NotImplementedError) this exception must not be raised; the deposit either proceeds and surfaces any genuine denial as an onchain revert, or a protocol adapter may fail closed with a plain VaultFlowUnavailable if unknown admission is unsafe.

Store structured context for a vault-flow failure.

__init__(reason, *, protocol=None, vault_address=None, caller=None, asset_address=None, direction=None, phase=None, decoded_error=None, preflight_result=None, raw_revert_data=None, requested_raw_amount=None, available_raw_amount=None, minimum_raw_amount=None, function_selector=None, error_selector=None, access_delay=None, next_open=None)

Store structured context for a vault-flow failure.

Parameters
Return type

None

__new__(**kwargs)
add_note(note, /)

Add a note to the exception

with_traceback(tb, /)

Set self.__traceback__ to tb and return self.