Vault V2 Allowlist Gate
The Vault V2 Allowlist Gate checks the addresses that deposit, withdraw, and transfer shares on a Vault V2 against an allowlist the gate's owner manages, enabling permissioned vaults, for example for institutional users.
For example, an institutional vault curator can deploy an allowlist gate with a list of approved wallets. Only those wallets can deposit into the vault or receive shares, and the vault's fee recipients (both managementFeeRecipient() and performanceFeeRecipient()) are allowed automatically.
Setup
Vault V2 Allowlist Gates are deployed via the VaultV2AllowlistGateFactory using CREATE2 for deterministic addresses. After deployment, the gate blocks all transfers by default because every permission flag defaults to false, with the sole exception of the vault's own fee recipients (described below).
Setup takes two steps:
- Deploy the gate via the factory, passing the owner address and a salt (for the deterministic CREATE2 address).
- The owner calls
setAllowlist(roles[])to configure permissions for participating addresses.
The owner can later call renounceOwnership() to make the allowlist permanently immutable.
Gate logic
Role-based permissions
Each allowlisted address has four independent permission flags.
- canReceiveShares: Whether the address can receive vault shares (for example, via deposit or transfer).
- canSendShares: Whether the address can send vault shares (for example, via withdraw or transfer).
- canReceiveAssets: Whether the address can receive underlying assets from the vault.
- canSendAssets: Whether the address can send underlying assets to the vault.
The gate checks these flags before executing share and asset transfers.
Ownership
The gate uses OpenZeppelin's Ownable2Step for two-step ownership transfers.
- The owner is the only address that can call
setAllowlistto update permissions for one or more addresses in a single call. - The owner can call
renounceOwnership()to permanently lock the allowlist, making it immutable.
Gate interface
The gate implements four view functions that a V2 vault queries:
canReceiveShares(address) → boolcanSendShares(address) → boolcanReceiveAssets(address) → boolcanSendAssets(address) → bool
For canReceiveShares, canSendShares and canReceiveAssets, the gate falls back to the calling vault's managementFeeRecipient() and performanceFeeRecipient() when an account is not on the allowlist. Both fee recipients are therefore allowed by default for these three flags. The fallback keeps fee accrual working, since a V2 vault skips fee minting when the recipient's gate check returns false. canSendAssets has no such exemption.
Use with Midnight vault-share collateral
When a vault's shares are used as collateral on a Morpho Midnight market, share movement is constrained to flow through Midnight, the supply and withdraw vault-shares callbacks, MidnightVaultExecutor, and, when borrow renewals are enabled, BorrowMidnightRenewalCallback. Each of these receives shares at some point in the flow, so the mandatory canReceiveShares allowlist for a vault-collateral market covers all of:
- Morpho Midnight
- the vault-shares supply and withdraw callbacks
MidnightVaultExecutorBorrowMidnightRenewalCallback(when borrow renewals are enabled)
A gate that allowlists only Morpho Midnight and the callbacks can still open positions, but executor-driven exits and liquidations revert with CannotReceiveShares because the executor cannot receive the returned shares.
BorrowMidnightRenewalCallback receives the vault-share collateral transiently while migrating a borrow position between two Midnight markets: it withdraws the shares from the source market before supplying them to the target market. Without the allowlist entry, the renewal take reverts with CannotReceiveShares. The cross-protocol migration callbacks (Blue to Midnight, Midnight to Blue) do not move Vault-V2 shares and are not allowlisted.
Confirm canReceiveShares returns true for MidnightVaultExecutor (and for BorrowMidnightRenewalCallback if borrow renewals are enabled) before calling renounceOwnership(). Once ownership is renounced, a contract omitted from the gate can no longer be added.
An omitted executor then permanently breaks the market's withdraw, repay and liquidation flows. An omitted renewal callback permanently breaks borrow renewals.
Use cases
- Permissioned vaults for institutional users.
- Vaults that restrict participation to addresses on the owner's allowlist; any identity verification behind the allowlist is the owner's responsibility.
- Vaults with restricted transfer capabilities, such as non-transferable shares.