🏭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:
uint256
number of vaults
getWhitelistedTokens
Returns a list of all whitelisted token addresses.
Return Value:
address[]
addresses of whitelisted tokens
getFeesReceiver
Returns the address of the fees receiver.
Call Parameters:
_feeType
uint256
0 corresponds to managementFeesReceiver
Return Value:
address
address of the fees receivercreateVault
isTokenWhitelisted
Checks if a token is whitelisted.
Call Parameters:
_tokens
address
token's address to check
Return Value:
bool
returns true
if the address of the token is whitelisted
getFactoryState
Returns all parameters from the factory.
Return Values:
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:
_vault
address
address of the vault
Return Values:
vTokens
VLib.Token[]
list of the tokens managed by the vault
constantProps
VLib.constantProps
constant parameters from the vault
historyProps
VLib.HistoryProps
previous parameters
configProps
VLib.ConfigProps
main configuration parameters from the vault
feesProps
VLib.FeesProps
fees parameter from the vault
securityProps
VLib.securityProps
security parameter from the vault
balances
uint256
amount of each assets in the vault
positions
uint256
positions from the vaults
vvl
uint256
vault's TVL
sharePrice
uint256
share price
ongoingFees
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:
_vault
address
address of the vault
Return Values:
ongoingManagementFees
uint256
amount of management fees to harvest
ongoingPerformanceFees
uint256
amount of performance fees to harvest
getShareState
Returns the share parameters from a vault according to its address.
Call Parameters:
_vault
address
address of the vault
Return Values:
share
address
address of vault's share
name
string
name of the vault's share
symbol
string
symbol of vault's share
decimals
uint8
vault's share decimals
supply
uint256
vault's share supply
transferable
bool
vault's share transferability
getUserShareState
Returns user's share information according to the vault's address and the user address.
Call Parameters:
_vault
address
address of the vault
_user
address
address of the user
Return Values:
share
address
address of vault's share
balance
uint256
amount of share in user's wallet
allowanceToVault
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:
_vault
address
address of the vault
Return Values:
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:
_tokensAddresses
address[]
all manageable assets
_creationProps
VLib.CreationProps
main vault information
_feesProps
VLib.FeesProps
fees parameters
_securityProps
VLib.SecurityProps
security parameters
setAccessManager
Settles the new AccessManager.
This method can only be called by the contract owner.
Call Parameters:
_newAccessManager
address
address of the new AccessManager
setFeesManager
Settles the new FeesManager.
This method can only be called by the contract owner.
Call Parameters:
_newFeesManager
address
address of the new FeesManager
setHarvester
Settles the new Harvester.
This method can only be called by the contract owner.
Call Parameters:
_newHarvester
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:
_newSwapRouter
address
address of the new router
_newSwapProxy
address
address of the new proxy
setSwapAdapter
Settles the new swap adapter.
This method can only be called by the contract owner.
Call Parameters:
_newSwapAdapter
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:
_token
address[]
list of tokens addresses to whitelist
_priceFeeds
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:
_tokens
address[]
list of tokens addresses to remove
Last updated