🏭Factory
Factory contract is the main contract of the protocol. It is used to create vault proxies and serves as registry.
View Methods
countVault
Returns the number of vaults from the factory.
Return Value:
Type | Description |
---|---|
uint256 | number of vaults |
getWhitelistedTokens
Returns a list of all whitelisted token addresses.
Return Value:
Type | Description |
---|---|
address[] | addresses of whitelisted tokens |
getFeesReceiver
Returns the address of the fees receiver.
Call Parameters:
Name | Type | Description |
---|---|---|
| uint256 | 0 corresponds to managementFeesReceiver |
Return Value:
Type | Description |
---|---|
address | address of the fees receivercreateVault |
isTokenWhitelisted
Checks if a token is whitelisted.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | token's address to check |
Return Value:
Type | Description |
---|---|
bool | returns |
getFactoryState
Returns all parameters from the factory.
Return Values:
Type | Description |
---|---|
address[] | addresses of the vaults |
address | address of the fees manager |
address | address of the access manager |
address | address of the harvester |
address | address of the proxy |
address | address of the router |
getVaultState
Returns the parameters of a vault.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the vault |
Return Values:
Name | Type | Description |
---|---|---|
| VLib.Token[] | list of the tokens managed by the vault |
| VLib.constantProps | constant parameters from the vault |
| VLib.HistoryProps | previous parameters |
| VLib.ConfigProps | main configuration parameters from the vault |
| VLib.FeesProps | fees parameter from the vault |
| VLib.securityProps | security parameter from the vault |
| uint256 | amount of each assets in the vault |
| uint256 | positions from the vaults |
| uint256 | vault's TVL |
| uint256 | share price |
| uint256[2] | amount of management and performance fees to harvest |
getVaultOngoingFees
Returns the amount of fees to harvest according to a vault address.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the vault |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | amount of management fees to harvest |
| uint256 | amount of performance fees to harvest |
getShareState
Returns the share parameters from a vault according to its address.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the vault |
Return Values:
Name | Type | Description |
---|---|---|
| address | address of vault's share |
| string | name of the vault's share |
| string | symbol of vault's share |
| uint8 | vault's share decimals |
| uint256 | vault's share supply |
| bool | vault's share transferability |
getUserShareState
Returns user's share information according to the vault's address and the user address.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the vault |
| address | address of the user |
Return Values:
Name | Type | Description |
---|---|---|
| address | address of vault's share |
| uint256 | amount of share in user's wallet |
| uint256 | allowance between the user and the vault |
getRolesPerVault
Returns the roles names and the addresses of the admins, strategists and harvesters according to a vault address.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the vault |
Return Values:
Type | Description |
---|---|
bytes32[3] | list of roles names |
address[] | list of admins addresses |
address[] | list of strategists addresses |
address[] | list of harvesters addresses |
Write Methods
createVault
Creates a vault with the parameters requested.
This method can only be called by address with VAULT_CREATOR_ROLE.
Call Parameters:
Name | Type | Description |
---|---|---|
| address[] | all manageable assets |
| VLib.CreationProps | main vault information |
| VLib.FeesProps | fees parameters |
| VLib.SecurityProps | security parameters |
setAccessManager
Settles the new AccessManager.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the new AccessManager |
setFeesManager
Settles the new FeesManager.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the new FeesManager |
setHarvester
Settles the new Harvester.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the new Harvester |
setSwapContracts
Settles the new aggregator proxy and router.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the new router |
| address | address of the new proxy |
setSwapAdapter
Settles the new swap adapter.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the new swap adapter |
addTokenAndPriceFeedsToWL
Whitelists a tokens and their oracles for vaults.
This method can only be called by the contract owner.
Call Parameters:
Name | Type | Description |
---|---|---|
| address[] | list of tokens addresses to whitelist |
| address[] | list token's oracle addresses to whitelist |
removeTokensFromWhitelist
Removes tokens and their oracles from the whitelist.
This method can only be called by the contract owner.
Parameters:
Name | Type | Description |
---|---|---|
| address[] | list of tokens addresses to remove |
Last updated