WhitelistingRequired
Documentation for eth_defi.vault.deposit_redeem.WhitelistingRequired exception.
- exception WhitelistingRequired
Bases:
eth_defi.vault.deposit_redeem.VaultFlowUnavailableA 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
VaultFlowUnavailableso 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
reasonmessage (the first positional argument, i.e. the text returned bystr(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()), andthe 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_addressandcallerstructured 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 structuredvault_addressandcallerfields 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 raiseNotImplementedError) 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 plainVaultFlowUnavailableif 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
reason (str) –
vault_address (Optional[eth_typing.evm.HexAddress]) –
caller (Optional[eth_typing.evm.HexAddress]) –
asset_address (Optional[eth_typing.evm.HexAddress]) –
raw_revert_data (Optional[hexbytes.main.HexBytes]) –
function_selector (Optional[hexbytes.main.HexBytes]) –
error_selector (Optional[hexbytes.main.HexBytes]) –
next_open (Optional[datetime.datetime]) –
- 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.