IPreDepositVault
Functions
initialize
Initializer of the contract.
function initialize(
PreDepositVaultInitParams calldata params,
address _shareToken,
address _depositToken,
address _accountingToken
) external;Parameters
| Name | Type | Description |
|---|---|---|
| params | PreDepositVaultInitParams | The initialization parameters. |
| _shareToken | address | The address of the share token. |
| _depositToken | address | The address of the deposit token. |
| _accountingToken | address | The address of the accounting token. |
migrated
True if the vault has migrated to a machine instance, false otherwise.
function migrated() external view returns (bool);Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
machine
Address of the machine, set during migration.
function machine() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
riskManager
Address of the risk manager.
function riskManager() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
whitelistMode
True if the vault is in whitelist mode, false otherwise.
function whitelistMode() external view returns (bool);Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
isWhitelistedUser
User => Whitelisting status.
function isWhitelistedUser(address user) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| user | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
depositToken
Address of the deposit token.
function depositToken() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
accountingToken
Address of the accounting token.
function accountingToken() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
shareToken
Address of the share token.
function shareToken() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
shareLimit
Share token supply limit that cannot be exceeded by new deposits.
function shareLimit() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
maxDeposit
Maximum amount of deposit tokens that can currently be deposited in the vault.
function maxDeposit() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
totalAssets
Total amount of deposit tokens managed by the vault.
function totalAssets() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
previewDeposit
Amount of shares minted against a given amount of deposit tokens.
function previewDeposit(uint256 assets) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of deposit tokens to be deposited. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
previewRedeem
Amount of deposit tokens that can be withdrawn against a given amount of shares.
function previewRedeem(uint256 shares) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The amount of shares to be redeemed. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
deposit
Deposits a given amount of deposit tokens and mints shares to the receiver.
function deposit(uint256 assets, address receiver, uint256 minShares, bytes32 referralKey)
external
returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of deposit tokens to be deposited. |
| receiver | address | The receiver of the shares. |
| minShares | uint256 | The minimum amount of shares to be minted. |
| referralKey | bytes32 | The optional identifier used to track a referral source. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | shares The amount of shares minted. |
redeem
Burns exactly shares from caller and transfers the corresponding amount of deposit tokens to the receiver.
function redeem(uint256 shares, address receiver, uint256 minAssets) external returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| shares | uint256 | The amount of shares to be redeemed. |
| receiver | address | The receiver of withdrawn deposit tokens. |
| minAssets | uint256 | The minimum amount of deposit tokens to be transferred. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | assets The amount of deposit tokens transferred. |
migrateToMachine
Migrates the pre-deposit vault to the machine.
function migrateToMachine() external;setPendingMachine
Sets the machine address to migrate to.
function setPendingMachine(address machine) external;Parameters
| Name | Type | Description |
|---|---|---|
| machine | address | The address of the machine. |
setShareLimit
Sets the new share token supply limit that cannot be exceeded by new deposits.
function setShareLimit(uint256 newShareLimit) external;Parameters
| Name | Type | Description |
|---|---|---|
| newShareLimit | uint256 | The new share limit. |
setRiskManager
Sets the risk manager address.
function setRiskManager(address newRiskManager) external;Parameters
| Name | Type | Description |
|---|---|---|
| newRiskManager | address | The address of the new risk manager. |
setWhitelistedUsers
Whitelist or unwhitelist a list of users.
function setWhitelistedUsers(address[] calldata users, bool whitelisted) external;Parameters
| Name | Type | Description |
|---|---|---|
| users | address[] | The addresses of the users to update. |
| whitelisted | bool | True to whitelist the users, false to unwhitelist. |
setWhitelistMode
Sets the whitelist mode for the vault.
In whitelist mode, only whitelisted users can deposit.
function setWhitelistMode(bool enabled) external;Parameters
| Name | Type | Description |
|---|---|---|
| enabled | bool | True to enable whitelist mode, false to disable. |
Events
Deposit
event Deposit(
address indexed sender, address indexed receiver, uint256 assets, uint256 shares, bytes32 indexed referralKey
);Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | |
| receiver | address | |
| assets | uint256 | |
| shares | uint256 | |
| referralKey | bytes32 |
MigrateToMachine
event MigrateToMachine(address indexed machine);Parameters
| Name | Type | Description |
|---|---|---|
| machine | address |
Redeem
event Redeem(address indexed owner, address indexed receiver, uint256 assets, uint256 shares);Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | |
| receiver | address | |
| assets | uint256 | |
| shares | uint256 |
RiskManagerChanged
event RiskManagerChanged(address indexed oldRiskManager, address indexed newRiskManager);Parameters
| Name | Type | Description |
|---|---|---|
| oldRiskManager | address | |
| newRiskManager | address |
ShareLimitChanged
event ShareLimitChanged(uint256 indexed oldShareLimit, uint256 indexed newShareLimit);Parameters
| Name | Type | Description |
|---|---|---|
| oldShareLimit | uint256 | |
| newShareLimit | uint256 |
UserWhitelistingChanged
event UserWhitelistingChanged(address indexed user, bool indexed whitelisted);Parameters
| Name | Type | Description |
|---|---|---|
| user | address | |
| whitelisted | bool |
WhitelistModeChanged
event WhitelistModeChanged(bool indexed enabled);Parameters
| Name | Type | Description |
|---|---|---|
| enabled | bool |
Structs
PreDepositVaultInitParams
struct PreDepositVaultInitParams {
uint256 initialShareLimit;
bool initialWhitelistMode;
address initialRiskManager;
address initialAuthority;
}Properties
| Name | Type | Description |
|---|---|---|
| initialShareLimit | uint256 | |
| initialWhitelistMode | bool | |
| initialRiskManager | address | |
| initialAuthority | address |