🏭Factory

Factory contract is the main contract of the protocol. It is used to create vault proxies and serves as registry.

View Methods

countVault

function countVault() external view returns (uint256)

Returns the number of vaults from the factory.

Return Value:

getWhitelistedTokens

function getWhitelistedTokens() external view returns (address[] memory)

Returns a list of all whitelisted token addresses.

Return Value:

getFeesReceiver

function getFeesReceiver(uint256 _feeType) external view returns (address)

Returns the address of the fees receiver.

Call Parameters:

Return Value:

isTokenWhitelisted

function isTokenWhitelisted(address _token) public view returns (bool)

Checks if a token is whitelisted.

Call Parameters:

Return Value:

getFactoryState

function getFactoryState()
    external
    view
    returns (
        address[] memory,
        address,
        address,
        address,
        address,
        address
    )

Returns all parameters from the factory.

Return Values:

getVaultState

function getVaultState(address _vault)
    external
    view
    returns (
        VLib.Token[] memory vTokens,
        VLib.ConstantProps memory constantProps,
        VLib.HistoryProps memory historyProps,
        VLib.ConfigProps memory configProps,
        VLib.FeesProps memory feesProps,
        VLib.SecurityProps memory securityProps,
        uint256[] memory balances,
        uint256[] memory positions,
        uint256 vvl,
        uint256 sharePrice,
        uint256[2] memory ongoingFees
    )

Returns the parameters of a vault.

Call Parameters:

Return Values:

getVaultOngoingFees

function getVaultOngoingFees(address _vault) 
    external 
    view 
    returns (
        uint256 ongoingManagementFees, 
        uint256 ongoingPerformanceFees
    )

Returns the amount of fees to harvest according to a vault address.

Call Parameters:

Return Values:

getShareState

function getShareState(address _vault)
    external
    view
    returns (
        address share,
        string memory name,
        string memory symbol,
        uint8 decimals,
        uint256 supply,
        bool transferable
    )

Returns the share parameters from a vault according to its address.

Call Parameters:

Return Values:

getUserShareState

function getUserShareState(address _vault, address _user)
    external
    view
    returns (
        address share,
        uint256 balance,
        uint256 allowanceToVault
    )

Returns user's share information according to the vault's address and the user address.

Call Parameters:

Return Values:

getRolesPerVault

function getRolesPerVault(address _vault)
    external
    view
    returns (
        bytes32[3] memory,
        address[] memory,
        address[] memory,
        address[] memory
    )

Returns the roles names and the addresses of the admins, strategists and harvesters according to a vault address.

Call Parameters:

Return Values:

Write Methods

createVault

function createVault(
    address[] calldata _tokensAddresses,
    VLib.CreationProps calldata _creationProps,
    VLib.FeesProps calldata _feesProps,
    VLib.SecurityProps calldata _securityProps
) external

Creates a vault with the parameters requested.

This method can only be called by address with VAULT_CREATOR_ROLE.

Call Parameters:

setAccessManager

function setAccessManager(address _newAccesslolManager) external

Settles the new AccessManager.

This method can only be called by the contract owner.

Call Parameters:

setFeesManager

function setFeesManager(address _newFeesManager) external

Settles the new FeesManager.

This method can only be called by the contract owner.

Call Parameters:

setHarvester

function setHarvester(address _newHarvester) external

Settles the new Harvester.

This method can only be called by the contract owner.

Call Parameters:

setSwapContracts

function setSwapContracts(address _newSwapRouter, address _newSwapProxy) external

Settles the new aggregator proxy and router.

This method can only be called by the contract owner.

Call Parameters:

setSwapAdapter

function setSwapAdapter(address _newSwapAdapter) external

Settles the new swap adapter.

This method can only be called by the contract owner.

Call Parameters:

addTokenAndPriceFeedsToWL

function addTokensAndPriceFeedsToWL(
    address[] calldata _tokens, 
    address[] calldata _priceFeeds
) external

Whitelists a tokens and their oracles for vaults.

This method can only be called by the contract owner.

Call Parameters:

removeTokensFromWhitelist

function removeTokensFromWhitelist(address[] calldata _tokens) external

Removes tokens and their oracles from the whitelist.

This method can only be called by the contract owner.

Parameters:

Last updated