Purpose

The SubvaultModule represents an isolated child vault within a modular vault system. It is tightly controlled by its parent vault (typically a VaultModule) and is responsible for securely holding and releasing assets upon authenticated requests.

Responsibilities

Storage Layout (SubvaultModuleStorage)

struct SubvaultModuleStorage {
  address vault;
}

The layout is stored in a deterministic custom slot derived using:

SlotLibrary.getSlot("SubvaultModule", name_, version_)

View Functions

vault() → address

Returns the address of the parent vault that instantiated this subvault.

Mutable Functions

pullAssets(asset: address, value: uint256)

Allows the parent vault to withdraw a specified amount of an asset.