IAssetManager
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
| Name | Type | Description |
|---|---|---|
asset_ | IERC20 | The asset to get the deposited shares for |
operator_ | address | The operator to get the deposited shares for |
Returns
| Name | Type | Description |
|---|---|---|
shares | uint256 | The number of shares deposited |
sharesInAssets | uint256 | The 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
| Name | Type | Description |
|---|---|---|
asset_ | IERC20 | The asset to get the configuration for |
Returns
| Name | Type | Description |
|---|---|---|
configuration | AssetConfiguration | The configuration for the asset |
getConfiguredAssets
Get the assets that are configured
function getConfiguredAssets() external view returns (IERC20[] memory assets);
Returns
| Name | Type | Description |
|---|---|---|
assets | IERC20[] | 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
| Name | Type | Description |
|---|---|---|
asset | address | The ERC20 asset |
depositCap | uint256 | The 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
| Name | Type | Description |
|---|---|---|
asset | address | The ERC20 asset |
minimumDeposit | uint256 | The 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
| Name | Type | Description |
|---|---|---|
isConfigured | bool | Whether the asset is configured |
depositCap | uint256 | The maximum amount of assets that can be deposited. Set to 0 to disable deposits. |
minimumDeposit | uint256 | The minimum amount of assets that can be deposited in a single transaction (set to 0 to disable the check) |
vault | address | The ERC4626 vault that the asset is deposited into |