IDepositController

Git Source

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

NameTypeDescription
senderaddressThe address of the sender depositing assets
assetsuint256The amount of assets being deposited
receiveraddressThe address receiving the shares

Returns

NameTypeDescription
sharesuint256The amount of shares minted for the deposit
feesuint256The 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

NameTypeDescription
senderaddressThe address of the sender minting shares
sharesuint256The amount of shares being minted
receiveraddressThe address receiving the assets

Returns

NameTypeDescription
assetsuint256The amount of assets corresponding to the minted shares
feesuint256The 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

NameTypeDescription
assetsuint256The amount of assets to be deposited

Returns

NameTypeDescription
sharesuint256The 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

NameTypeDescription
sharesuint256The amount of shares to be minted

Returns

NameTypeDescription
assetsuint256The 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

NameTypeDescription
receiveraddressThe address receiving the shares
ceilinguint256The maximum allowed total assets

Returns

NameTypeDescription
assetsuint256The 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

NameTypeDescription
receiveraddressThe address receiving the assets
ceilinguint256The maximum allowed total assets

Returns

NameTypeDescription
sharesuint256The maximum number of shares that can be minted under the given ceiling

setDepositFeeRate

Set the deposit fee rate

function setDepositFeeRate(uint256 _depositFeeRate) external;

Parameters

NameTypeDescription
_depositFeeRateuint256The new deposit fee rate