Developers Documentation
  • Overview
    • Contracts Overview
    • Public Repositories
    • Smart Contract Addresses
      • Polygon PoS
  • Core protocol
    • Architecture Overview
    • Blocks
    • Vault Strategy
    • Vault Configuration
    • Vault Deployment
    • Vault Operations
    • Access Manager
    • Contracts
      • StrategVault
      • StrategERC3525
      • StrategVaultFactory
      • StrategAssetBuffer
      • StrategBlockRegistry
      • StrategUserInteractions
      • StrategOperatorProxy
      • StrategOperatorDataAggregator
  • Borrow module
    • Architecture Overview
    • Aave V3 Position manager
    • Smart Contract Docs
      • StrategPositionManagerFactory
      • StrategAaveV3PositionManager
      • StrategAaveV3PositionManagerInfo
  • Portal Module
    • Architecture Overview
    • Swap
      • Features
      • Functions
    • Oracle
      • Architecture design
      • Functions
  • Tools
    • Developer kit
Powered by GitBook
On this page
  • Methods
  • ERC3525_VERSION
  • VAULT_VERSION
  • addressIsWhitelistedOnVault
  • addressProvider
  • authority
  • deployNewVault
  • editVaultParams
  • erc3525Implementation
  • executeVaultParamsEdit
  • getBatchVaultAddresses
  • getVaultConfiguration
  • getVaultDepositLimits
  • getVaultHoldingParams
  • getVaultMinimalDepositLimits
  • getVaultReadableConfiguration
  • isConsumingScheduledOp
  • protocolFee
  • setAuthority
  • setProtocolFee
  • setVaultProtocolFee
  • setVaultStrat
  • upgradeERC3525
  • upgradeVault
  • vaultDeposit
  • vaultImplementation
  • vaultParamsChangeQueue
  • vaultParamsInitialized
  • vaults
  • vaultsLength
  • Events
  • AuthorityUpdated
  • EditWhitelist
  • MiddlewareInit
  • NewBufferParams
  • NewDepositLimits
  • NewERC2535Implementation
  • NewFeeParams
  • NewHoldingParams
  • NewTimelockParams
  • NewVault
  • NewVaultImplementation
  • NewVaultParametersEditQueueItem
  • VaultParametersEditQueueItemExecuted
  • Errors
  • AccessManagedInvalidAuthority
  • AccessManagedRequiredDelay
  • AccessManagedUnauthorized
  • BadBufferParams
  • BadCreatorFee
  • BadHarvestFee
  • BadPositionManagerAddress
  • DepositExecutionFailed
  • ERC1167FailedCreateClone
  • EditParamsQueueIndexOutOfBound
  • EditParamsQueueTimelockNotReach
  • INVALID_BUFFER_DERIVATION
  • INVALID_BUFFER_SIZE
  • INVALID_CREATOR_FEE
  • INVALID_HARVEST_BLOCKS_LENGTH
  • INVALID_HARVEST_FEE
  • INVALID_LIMIT_MODE
  • INVALID_MIDDLEWARE_STRATEGY
  • INVALID_PROTOCOL_FEE
  • INVALID_STRATEGY_BLOCKS_LENGTH
  • INVALID_TIMELOCK_DURATION
  • InvalidProtocolFee
  • NotFactory
  • NotInitialized
  • NotOwner
  • NotUserInteractions
  • NotVaultOwner
  • NotWhitelisted
  1. Core protocol
  2. Contracts

StrategVaultFactory

Factory contract for deploying StrategVault instances.

Methods

ERC3525_VERSION

function ERC3525_VERSION() external view returns (uint256)

The current version of the ERC3525 logic contract

Returns

Name
Type
Description

_0

uint256

undefined

VAULT_VERSION

function VAULT_VERSION() external view returns (uint256)

The current version of the vault logic contract

Returns

Name
Type
Description

_0

uint256

undefined

addressIsWhitelistedOnVault

function addressIsWhitelistedOnVault(address _vault, address _user) external view returns (bool)

Check if an address is whitelisted on a vault

Parameters

Name
Type
Description

_vault

address

Vault address

_user

address

undefined

Returns

Name
Type
Description

_0

bool

whitelisted Boolean returning if a user is whitelisted

addressProvider

function addressProvider() external view returns (contract IStrategAddressesProvider)

Address provider for the factory, indicating if the factory has been initialized

Returns

Name
Type
Description

_0

contract IStrategAddressesProvider

undefined

authority

function authority() external view returns (address)

Returns the current authority.

Returns

Name
Type
Description

_0

address

undefined

deployNewVault

function deployNewVault(string _name, string _symbol, address _owner, address _asset, uint256 _strategy, uint256 _bufferSize, uint256 _creatorFees, uint256 _harvestFees, string _ipfsHash) external nonpayable

Deploy a new StrategVault contract.

Parameters

Name
Type
Description

_name

string

The name of the vault.

_symbol

string

The symbol of the vault.

_owner

address

The address of the vault owner.

_asset

address

The address of the underlying asset.

_strategy

uint256

The strategy to be used by the vault.

_bufferSize

uint256

The buffer size for the vault.

_creatorFees

uint256

The creator fees for the vault.

_harvestFees

uint256

The harvest fees for the vault.

_ipfsHash

string

The IPFS hash associated with the vault.

editVaultParams

function editVaultParams(address _user, address _vault, enum IStrategVault.StrategVaultSettings[] _settings, bytes[] _data) external nonpayable

Edit vault configuration.

Parameters

Name
Type
Description

_user

address

sender from StrategUserInteractions.

_vault

address

Targeted vault

_settings

enum IStrategVault.StrategVaultSettings[]

Array of settings identifier to edits.

_data

bytes[]

Array of values corresponding to settings.

erc3525Implementation

function erc3525Implementation() external view returns (address)

The implementation address of the ERC3525 token

Returns

Name
Type
Description

_0

address

undefined

executeVaultParamsEdit

function executeVaultParamsEdit(address _vault, uint256 _index) external nonpayable

Edit vault configuration.

Parameters

Name
Type
Description

_vault

address

Targeted vault

_index

uint256

Array of settings identifier to edits.

getBatchVaultAddresses

function getBatchVaultAddresses(uint256[] _indexes) external view returns (address[])

Get the batch vault addresses for a given array of indices.

Parameters

Name
Type
Description

_indexes

uint256[]

The array of vault index.

Returns

Name
Type
Description

_0

address[]

An array of vault addresses corresponding to the given indices.

getVaultConfiguration

function getVaultConfiguration(address _vault) external view returns (struct DataTypes.VaultConfigurationMap)

Sets the deposit limits for user and vault.

Parameters

Name
Type
Description

_vault

address

Vault address

Returns

Name
Type
Description

_0

DataTypes.VaultConfigurationMap

_config Vault configuration Bitmap

getVaultDepositLimits

function getVaultDepositLimits(address _vault) external view returns (uint256 _minUserDeposit, uint256 _maxUserDeposit, uint256 _minVaultDeposit, uint256 _maxVaultDeposit)

Sets the deposit limits for user and vault.

Parameters

Name
Type
Description

_vault

address

Vault address

Returns

Name
Type
Description

_minUserDeposit

uint256

Minimum user deposit

_maxUserDeposit

uint256

Maximum user deposit

_minVaultDeposit

uint256

Minimum vault deposit

_maxVaultDeposit

uint256

Maximum vault deposit

getVaultHoldingParams

function getVaultHoldingParams(address _vault) external view returns (address token, uint256 amount)

Get holding parameters for a vault

Parameters

Name
Type
Description

_vault

address

Vault address

Returns

Name
Type
Description

token

address

Token to hold

amount

uint256

Amount to hold

getVaultMinimalDepositLimits

function getVaultMinimalDepositLimits(address _vault) external view returns (uint256)

get the min deposit limits for a vault.

Parameters

Name
Type
Description

_vault

address

Vault address

Returns

Name
Type
Description

_0

uint256

_minVaultDeposit Minimum vault deposit

getVaultReadableConfiguration

function getVaultReadableConfiguration(address _vault) external view returns (uint256 _middlewareStrategy, uint256 _limitMode, uint256 _timelockDuration, uint256 _creatorFee, uint256 _harvestFee, uint256 _protocolFee, uint256 _bufferSize, uint256 _bufferDerivation, uint256 _strategyBlocksLength, uint256 _harvestBlocksLength, uint256 _lastHarvestIndex)

Return separated vault config bitmap value

Parameters

Name
Type
Description

_vault

address

Vault address

Returns

Name
Type
Description

_middlewareStrategy

uint256

The middleware strategy for the vault.

_limitMode

uint256

The limit mode for the vault.

_timelockDuration

uint256

The timelock duration for the vault.

_creatorFee

uint256

The creator fee for the vault.

_harvestFee

uint256

The harvest fee for the vault.

_protocolFee

uint256

The protocol fee for the vault.

_bufferSize

uint256

The buffer size for the vault.

_bufferDerivation

uint256

The buffer derivation for the vault.

_strategyBlocksLength

uint256

The strategy blocks length for the vault.

_harvestBlocksLength

uint256

The harvest blocks length for the vault.

_lastHarvestIndex

uint256

The last harvest index for the vault.

isConsumingScheduledOp

function isConsumingScheduledOp() external view returns (bytes4)

Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls.

Returns

Name
Type
Description

_0

bytes4

undefined

protocolFee

function protocolFee() external view returns (uint256)

The protocol fee charged for vault operations

Returns

Name
Type
Description

_0

uint256

undefined

setAuthority

function setAuthority(address newAuthority) external nonpayable

Transfers control to a new authority. The caller must be the current authority.

Parameters

Name
Type
Description

newAuthority

address

undefined

setProtocolFee

function setProtocolFee(uint256 _fee) external nonpayable

Set the protocol fee.

Parameters

Name
Type
Description

_fee

uint256

The new protocol fee.

setVaultProtocolFee

function setVaultProtocolFee(address _vault, uint256 _fee) external nonpayable

Sets the deposit limits for user and vault.

Parameters

Name
Type
Description

_vault

address

Vault address

_fee

uint256

The new vault protocol fee

setVaultStrat

function setVaultStrat(address _user, address _vault, address[] _positionManagers, address[] _stratBlocks, bytes[] _stratBlocksParameters, bool[] _isFinalBlock, address[] _harvestBlocks, bytes[] _harvestBlocksParameters) external nonpayable

Set the strategy blocks for the vault.

Parameters

Name
Type
Description

_user

address

sender from StrategUserInteractions.

_vault

address

Targeted vault

_positionManagers

address[]

Array of position managers.

_stratBlocks

address[]

Array of strategy blocks.

_stratBlocksParameters

bytes[]

Array of strategy block parameters.

_isFinalBlock

bool[]

undefined

_harvestBlocks

address[]

Array of harvest blocks.

_harvestBlocksParameters

bytes[]

Array of harvest block parameters.

upgradeERC3525

function upgradeERC3525(address _implementation) external nonpayable

Upgrade the ERC3525 implementation contract.

Parameters

Name
Type
Description

_implementation

address

The address of the new implementation contract.

upgradeVault

function upgradeVault(address _implementation) external nonpayable

Upgrade the vault implementation contract.

Parameters

Name
Type
Description

_implementation

address

The address of the new implementation contract.

vaultDeposit

function vaultDeposit(address _user, address _vault, uint256 _assets, address _receiver) external nonpayable

Edit vault configuration.

Parameters

Name
Type
Description

_user

address

sender from StrategUserInteractions.

_vault

address

Targeted vault

_assets

uint256

Array of settings identifier to edits.

_receiver

address

Array of values corresponding to settings.

vaultImplementation

function vaultImplementation() external view returns (address)

The implementation address of the vault

Returns

Name
Type
Description

_0

address

undefined

vaultParamsChangeQueue

function vaultParamsChangeQueue(address, uint256) external view returns (uint256 initializedAt)

Mapping from vault address to vault settings update queue

Parameters

Name
Type
Description

_0

address

undefined

_1

uint256

undefined

Returns

Name
Type
Description

initializedAt

uint256

undefined

vaultParamsInitialized

function vaultParamsInitialized(address) external view returns (bool)

Mapping from vault address to settings timelock

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

vaults

function vaults(uint256) external view returns (address)

Mapping from vault index to vault address

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

vaultsLength

function vaultsLength() external view returns (uint256)

The total number of vaults created by the factory

Returns

Name
Type
Description

_0

uint256

undefined

Events

AuthorityUpdated

event AuthorityUpdated(address authority)

Authority that manages this contract was updated.

Parameters

Name
Type
Description

authority

address

undefined

EditWhitelist

event EditWhitelist(address indexed vault, bool add, address addr)

Emitted when the whitelist is edited for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

add

bool

Boolean indicating if the address is being added (true) or removed (false).

addr

address

The address being added or removed from the whitelist.

MiddlewareInit

event MiddlewareInit(address indexed vault, uint256 strategy)

Emitted when middleware is initialized for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

strategy

uint256

The identifier of the strategy.

NewBufferParams

event NewBufferParams(address indexed vault, uint256 bufferSize, uint256 bufferDerivation)

Emitted when buffer parameters are updated for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

bufferSize

uint256

The size of the buffer.

bufferDerivation

uint256

The derivation method of the buffer.

NewDepositLimits

event NewDepositLimits(address indexed vault, uint256 minUserDeposit, uint256 maxUserDeposit, uint256 minVaultDeposit, uint256 maxVaultDeposit)

Emitted when deposit limits are updated for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

minUserDeposit

uint256

The minimum deposit amount allowed per user.

maxUserDeposit

uint256

The maximum deposit amount allowed per user.

minVaultDeposit

uint256

The minimum deposit amount allowed for the vault.

maxVaultDeposit

uint256

The maximum deposit amount allowed for the vault.

NewERC2535Implementation

event NewERC2535Implementation(uint256 indexed version, address implementation)

Emitted when StrategERC3525 is upgraded

Parameters

Name
Type
Description

version indexed

uint256

The new version id.

implementation

address

The address of the new implementation.

NewFeeParams

event NewFeeParams(address indexed vault, uint256 creatorFees, uint256 harvestFees)

Emitted when fee parameters are updated for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

creatorFees

uint256

The fees allocated to the creator.

harvestFees

uint256

The fees allocated for harvesting.

NewHoldingParams

event NewHoldingParams(address indexed vault, address token, uint256 amount)

Emitted when holding parameters are set for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

token

address

The address of the token being held.

amount

uint256

The amount of the token being held.

NewTimelockParams

event NewTimelockParams(address indexed vault, uint256 duration)

Emitted when new timelock parameters are set for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

duration

uint256

The duration of the timelock in seconds.

NewVault

event NewVault(uint256 indexed id, address indexed addr, string name, string symbol, address asset, address indexed owner, address erc3525, address implementation, string ipfsHash)

Emitted when StrategVault is upgraded

Parameters

Name
Type
Description

id indexed

uint256

The new version id.

addr indexed

address

The address of the new implementation.

name

string

The address of the new implementation.

symbol

string

The address of the new implementation.

asset

address

The address of the new implementation.

owner indexed

address

The address of the new implementation.

erc3525

address

The address of the new implementation.

implementation

address

The address of the new implementation.

ipfsHash

string

The address of the new implementation.

NewVaultImplementation

event NewVaultImplementation(uint256 indexed version, address implementation)

Emitted when StrategVault is upgraded

Parameters

Name
Type
Description

version indexed

uint256

The new version id.

implementation

address

The address of the new implementation.

NewVaultParametersEditQueueItem

event NewVaultParametersEditQueueItem(address indexed vault, uint256 index)

Emitted when fee parameters are updated for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

index

uint256

The fees allocated to the creator.

VaultParametersEditQueueItemExecuted

event VaultParametersEditQueueItemExecuted(address indexed vault, uint256 index)

Emitted when fee parameters are updated for a vault.

Parameters

Name
Type
Description

vault indexed

address

The address of the vault.

index

uint256

The fees allocated to the creator.

Errors

AccessManagedInvalidAuthority

error AccessManagedInvalidAuthority(address authority)

Parameters

Name
Type
Description

authority

address

undefined

AccessManagedRequiredDelay

error AccessManagedRequiredDelay(address caller, uint32 delay)

Parameters

Name
Type
Description

caller

address

undefined

delay

uint32

undefined

AccessManagedUnauthorized

error AccessManagedUnauthorized(address caller)

Parameters

Name
Type
Description

caller

address

undefined

BadBufferParams

error BadBufferParams()

Error thrown when the buffer parameters are not within acceptable parameters.

BadCreatorFee

error BadCreatorFee()

Error thrown when the creator fee is not within acceptable parameters.

BadHarvestFee

error BadHarvestFee()

Error thrown when the harvest fee is not within acceptable parameters.

BadPositionManagerAddress

error BadPositionManagerAddress()

Error thrown when an invalid position manager address is provided.

DepositExecutionFailed

error DepositExecutionFailed(bytes returnedData)

Error thrown when a deposit execution fails.

Parameters

Name
Type
Description

returnedData

bytes

The data returned from the failed deposit execution.

ERC1167FailedCreateClone

error ERC1167FailedCreateClone()

A clone instance deployment failed.

EditParamsQueueIndexOutOfBound

error EditParamsQueueIndexOutOfBound()

Error thrown when an attempt to edit settings is made before the timelock period has reached.

EditParamsQueueTimelockNotReach

error EditParamsQueueTimelockNotReach()

Error thrown when an attempt to edit settings is made before the timelock period has reached.

INVALID_BUFFER_DERIVATION

error INVALID_BUFFER_DERIVATION()

Error triggered when the buffer derivation is not within the valid range

INVALID_BUFFER_SIZE

error INVALID_BUFFER_SIZE()

Error triggered when the buffer size is not within the valid range

INVALID_CREATOR_FEE

error INVALID_CREATOR_FEE()

Error triggered when the creator fee is not within the valid range

INVALID_HARVEST_BLOCKS_LENGTH

error INVALID_HARVEST_BLOCKS_LENGTH()

Error triggered when the harvest blocks length is not within the valid range

INVALID_HARVEST_FEE

error INVALID_HARVEST_FEE()

Error triggered when the harvest fee is not within the valid range

INVALID_LIMIT_MODE

error INVALID_LIMIT_MODE()

Error triggered when the limit mode is not within the valid range

INVALID_MIDDLEWARE_STRATEGY

error INVALID_MIDDLEWARE_STRATEGY()

Error triggered when the middleware strategy is not within the valid range

INVALID_PROTOCOL_FEE

error INVALID_PROTOCOL_FEE()

Error triggered when the protocol fee is not within the valid range

INVALID_STRATEGY_BLOCKS_LENGTH

error INVALID_STRATEGY_BLOCKS_LENGTH()

Error triggered when the strategy blocks length is not within the valid range

INVALID_TIMELOCK_DURATION

error INVALID_TIMELOCK_DURATION()

Error triggered when the timelock duration is not within the valid range

InvalidProtocolFee

error InvalidProtocolFee()

Error thrown when an invalid protocol fee is set.

NotFactory

error NotFactory()

Error thrown when the caller is not the factory contract.

NotInitialized

error NotInitialized()

Error thrown when the factory has not been initialized.

NotOwner

error NotOwner()

Error thrown when the caller is not the owner.

NotUserInteractions

error NotUserInteractions()

Error thrown when the caller is not the owner.

NotVaultOwner

error NotVaultOwner()

Error thrown when the caller is not the vault owner.

NotWhitelisted

error NotWhitelisted()

Error thrown when the caller is not whitelisted.

PreviousStrategERC3525NextStrategAssetBuffer

Last updated 1 year ago