Skip to main content

IAssetManager

Git Source

Title: IAssetManager

This interface defines the functions for custodying assets. A depositor can deposit assets into a vault, and withdraw them later. An operator is the contract that acts on behalf of the depositor. Only operators can interact with the contract. The deposits facilitated by an operator are siloed from other operators.

Functions

getOperatorAssets

Get the number of assets deposited for an asset and operator

function getOperatorAssets(IERC20 asset_, address operator_)
external
view
returns (uint256 shares, uint256 sharesInAssets);

Parameters

NameTypeDescription
asset_IERC20The asset to get the deposited shares for
operator_addressThe operator to get the deposited shares for

Returns

NameTypeDescription
sharesuint256The number of shares deposited
sharesInAssetsuint256The number of shares deposited (in terms of assets)

getAssetConfiguration

Get the configuration for an asset

function getAssetConfiguration(IERC20 asset_) external view returns (AssetConfiguration memory configuration);

Parameters

NameTypeDescription
asset_IERC20The asset to get the configuration for

Returns

NameTypeDescription
configurationAssetConfigurationThe configuration for the asset

getConfiguredAssets

Get the assets that are configured

function getConfiguredAssets() external view returns (IERC20[] memory assets);

Returns

NameTypeDescription
assetsIERC20[]The assets that are configured

Events

AssetConfigured

event AssetConfigured(address indexed asset, address indexed vault);

AssetDepositCapSet

Emitted when an asset's deposit cap is updated

event AssetDepositCapSet(address indexed asset, uint256 depositCap);

Parameters

NameTypeDescription
assetaddressThe ERC20 asset
depositCapuint256The new deposit cap amount (in asset units)

AssetMinimumDepositSet

Emitted when an asset's minimum single-deposit amount is updated

event AssetMinimumDepositSet(address indexed asset, uint256 minimumDeposit);

Parameters

NameTypeDescription
assetaddressThe ERC20 asset
minimumDeposituint256The new minimum deposit amount (in asset units)

AssetDeposited

event AssetDeposited(
address indexed asset, address indexed depositor, address indexed operator, uint256 amount, uint256 shares
);

AssetWithdrawn

event AssetWithdrawn(
address indexed asset, address indexed withdrawer, address indexed operator, uint256 amount, uint256 shares
);

Errors

AssetManager_NotConfigured

error AssetManager_NotConfigured();

AssetManager_InvalidAsset

error AssetManager_InvalidAsset();

AssetManager_AssetAlreadyConfigured

error AssetManager_AssetAlreadyConfigured();

AssetManager_VaultAssetMismatch

error AssetManager_VaultAssetMismatch();

AssetManager_ZeroAmount

error AssetManager_ZeroAmount();

AssetManager_DepositCapExceeded

error AssetManager_DepositCapExceeded(address asset, uint256 existingDepositAmount, uint256 depositCap);

AssetManager_MinimumDepositNotMet

error AssetManager_MinimumDepositNotMet(address asset, uint256 depositAmount, uint256 minimumDeposit);

AssetManager_MinimumDepositExceedsDepositCap

error AssetManager_MinimumDepositExceedsDepositCap(address asset, uint256 minimumDeposit, uint256 depositCap);

Structs

AssetConfiguration

Configuration for an asset

struct AssetConfiguration {
bool isConfigured;
uint256 depositCap;
uint256 minimumDeposit;
address vault;
}

Properties

NameTypeDescription
isConfiguredboolWhether the asset is configured
depositCapuint256The maximum amount of assets that can be deposited. Set to 0 to disable deposits.
minimumDeposituint256The minimum amount of assets that can be deposited in a single transaction (set to 0 to disable the check)
vaultaddressThe ERC4626 vault that the asset is deposited into