VaultFactory

Git Source

Author: Molecular Labs

Factory contract for deploying Ion Lending Vaults.

Functions

createVault

Deploys a new Ion Lending Vault. Transfers the initialDeposit amount of the base asset from the caller initiate the first deposit to the vault. The minimum initialDeposit is 1e3. If less, this call would underflow as it will always burn 1e3 shares of the total shares minted to defend against inflation attacks.

The 1e3 initial deposit amount was chosen to defend against inflation attacks, referencing the UniV2 LP token implementation.

function createVault(
    IERC20 baseAsset,
    address feeRecipient,
    uint256 feePercentage,
    string memory name,
    string memory symbol,
    uint48 initialDelay,
    address initialDefaultAdmin,
    bytes32 salt,
    Vault.MarketsArgs memory marketsArgs,
    uint256 initialDeposit
)
    external
    returns (Vault vault);

Parameters

Events

CreateVault

event CreateVault(
    address vault,
    IERC20 indexed baseAsset,
    address feeRecipient,
    uint256 feePercentage,
    string name,
    string symbol,
    address indexed initialDefaultAdmin
);