IDepositController
Functions
onDeposit
Handle deposit of assets and distribute shares and fees accordingly
function onDeposit(address sender, uint256 assets, address receiver) external returns (uint256 shares, uint256 fees);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The address of the sender depositing assets |
assets | uint256 | The amount of assets being deposited |
receiver | address | The address receiving the shares |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of shares minted for the deposit |
fees | uint256 | The amount of fees collected during the deposit |
onMint
Handle minting of shares and distribute assets and fees accordingly
function onMint(address sender, uint256 shares, address receiver) external returns (uint256 assets, uint256 fees);
Parameters
Name | Type | Description |
---|---|---|
sender | address | The address of the sender minting shares |
shares | uint256 | The amount of shares being minted |
receiver | address | The address receiving the assets |
Returns
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets corresponding to the minted shares |
fees | uint256 | The amount of fees collected during the minting |
previewDeposit
Preview the number of shares that will be minted for a given amount of assets
function previewDeposit(uint256 assets) external view returns (uint256 shares);
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to be deposited |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | The estimated number of shares to be minted |
previewMint
Preview the total amount of assets (including fees) for a given number of shares
function previewMint(uint256 shares) external view returns (uint256 assets);
Parameters
Name | Type | Description |
---|---|---|
shares | uint256 | The amount of shares to be minted |
Returns
Name | Type | Description |
---|---|---|
assets | uint256 | The estimated total amount of assets (including fees) for the given shares |
maxDeposit
Calculate the maximum deposit amount based on the given ceiling
function maxDeposit(address receiver, uint256 ceiling) external view returns (uint256 assets);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address receiving the shares |
ceiling | uint256 | The maximum allowed total assets |
Returns
Name | Type | Description |
---|---|---|
assets | uint256 | The maximum deposit amount under the given ceiling |
maxMint
Calculate the maximum number of shares that can be minted based on the given ceiling
function maxMint(address receiver, uint256 ceiling) external view returns (uint256 shares);
Parameters
Name | Type | Description |
---|---|---|
receiver | address | The address receiving the assets |
ceiling | uint256 | The maximum allowed total assets |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | The maximum number of shares that can be minted under the given ceiling |
setDepositFeeRate
Set the deposit fee rate
function setDepositFeeRate(uint256 _depositFeeRate) external;
Parameters
Name | Type | Description |
---|---|---|
_depositFeeRate | uint256 | The new deposit fee rate |