# StrategVaultFactory

## Methods

### ERC3525\_VERSION

```solidity
function ERC3525_VERSION() external view returns (uint256)
```

The current version of the ERC3525 logic contract

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### VAULT\_VERSION

```solidity
function VAULT_VERSION() external view returns (uint256)
```

The current version of the vault logic contract

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### addressIsWhitelistedOnVault

```solidity
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

```solidity
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

```solidity
function authority() external view returns (address)
```

*Returns the current authority.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### deployNewVault

```solidity
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

```solidity
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

```solidity
function erc3525Implementation() external view returns (address)
```

The implementation address of the ERC3525 token

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### executeVaultParamsEdit

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

<table><thead><tr><th width="142">Name</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td>_0</td><td>uint256</td><td>_minVaultDeposit Minimum vault deposit</td></tr></tbody></table>

### getVaultReadableConfiguration

```solidity
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

<table><thead><tr><th width="229">Name</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_middlewareStrategy</td><td>uint256</td><td>The middleware strategy for the vault.</td></tr><tr><td>_limitMode</td><td>uint256</td><td>The limit mode for the vault.</td></tr><tr><td>_timelockDuration</td><td>uint256</td><td>The timelock duration for the vault.</td></tr><tr><td>_creatorFee</td><td>uint256</td><td>The creator fee for the vault.</td></tr><tr><td>_harvestFee</td><td>uint256</td><td>The harvest fee for the vault.</td></tr><tr><td>_protocolFee</td><td>uint256</td><td>The protocol fee for the vault.</td></tr><tr><td>_bufferSize</td><td>uint256</td><td>The buffer size for the vault.</td></tr><tr><td>_bufferDerivation</td><td>uint256</td><td>The buffer derivation for the vault.</td></tr><tr><td>_strategyBlocksLength</td><td>uint256</td><td>The strategy blocks length for the vault.</td></tr><tr><td>_harvestBlocksLength</td><td>uint256</td><td>The harvest blocks length for the vault.</td></tr><tr><td>_lastHarvestIndex</td><td>uint256</td><td>The last harvest index for the vault.</td></tr></tbody></table>

### isConsumingScheduledOp

```solidity
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

```solidity
function protocolFee() external view returns (uint256)
```

The protocol fee charged for vault operations

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### setAuthority

```solidity
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

```solidity
function setProtocolFee(uint256 _fee) external nonpayable
```

Set the protocol fee.

#### Parameters

| Name  | Type    | Description           |
| ----- | ------- | --------------------- |
| \_fee | uint256 | The new protocol fee. |

### setVaultProtocolFee

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
function vaultImplementation() external view returns (address)
```

The implementation address of the vault

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### vaultParamsChangeQueue

```solidity
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

```solidity
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

```solidity
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

```solidity
function vaultsLength() external view returns (uint256)
```

The total number of vaults created by the factory

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

## Events

### AuthorityUpdated

```solidity
event AuthorityUpdated(address authority)
```

*Authority that manages this contract was updated.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| authority | address | undefined   |

### EditWhitelist

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
error AccessManagedInvalidAuthority(address authority)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| authority | address | undefined   |

### AccessManagedRequiredDelay

```solidity
error AccessManagedRequiredDelay(address caller, uint32 delay)
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| caller | address | undefined   |
| delay  | uint32  | undefined   |

### AccessManagedUnauthorized

```solidity
error AccessManagedUnauthorized(address caller)
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| caller | address | undefined   |

### BadBufferParams

```solidity
error BadBufferParams()
```

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

### BadCreatorFee

```solidity
error BadCreatorFee()
```

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

### BadHarvestFee

```solidity
error BadHarvestFee()
```

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

### BadPositionManagerAddress

```solidity
error BadPositionManagerAddress()
```

*Error thrown when an invalid position manager address is provided.*

### DepositExecutionFailed

```solidity
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

```solidity
error ERC1167FailedCreateClone()
```

*A clone instance deployment failed.*

### EditParamsQueueIndexOutOfBound

```solidity
error EditParamsQueueIndexOutOfBound()
```

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

### EditParamsQueueTimelockNotReach

```solidity
error EditParamsQueueTimelockNotReach()
```

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

### INVALID\_BUFFER\_DERIVATION

```solidity
error INVALID_BUFFER_DERIVATION()
```

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

### INVALID\_BUFFER\_SIZE

```solidity
error INVALID_BUFFER_SIZE()
```

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

### INVALID\_CREATOR\_FEE

```solidity
error INVALID_CREATOR_FEE()
```

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

### INVALID\_HARVEST\_BLOCKS\_LENGTH

```solidity
error INVALID_HARVEST_BLOCKS_LENGTH()
```

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

### INVALID\_HARVEST\_FEE

```solidity
error INVALID_HARVEST_FEE()
```

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

### INVALID\_LIMIT\_MODE

```solidity
error INVALID_LIMIT_MODE()
```

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

### INVALID\_MIDDLEWARE\_STRATEGY

```solidity
error INVALID_MIDDLEWARE_STRATEGY()
```

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

### INVALID\_PROTOCOL\_FEE

```solidity
error INVALID_PROTOCOL_FEE()
```

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

### INVALID\_STRATEGY\_BLOCKS\_LENGTH

```solidity
error INVALID_STRATEGY_BLOCKS_LENGTH()
```

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

### INVALID\_TIMELOCK\_DURATION

```solidity
error INVALID_TIMELOCK_DURATION()
```

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

### InvalidProtocolFee

```solidity
error InvalidProtocolFee()
```

*Error thrown when an invalid protocol fee is set.*

### NotFactory

```solidity
error NotFactory()
```

*Error thrown when the caller is not the factory contract.*

### NotInitialized

```solidity
error NotInitialized()
```

*Error thrown when the factory has not been initialized.*

### NotOwner

```solidity
error NotOwner()
```

*Error thrown when the caller is not the owner.*

### NotUserInteractions

```solidity
error NotUserInteractions()
```

*Error thrown when the caller is not the owner.*

### NotVaultOwner

```solidity
error NotVaultOwner()
```

*Error thrown when the caller is not the vault owner.*

### NotWhitelisted

```solidity
error NotWhitelisted()
```

*Error thrown when the caller is not whitelisted.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.strateg.io/core-protocol/contracts/strategvaultfactory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
