> For the complete documentation index, see [llms.txt](https://developers.strateg.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.strateg.io/core-protocol/contracts/strateguserinteractions.md).

# StrategUserInteractions

Additional contract to implement permit1, permit2 and ERC2771 features. It is used as main user interactions contract

## Methods

### addressProvider

```solidity
function addressProvider() external view returns (contract IStrategAddressesProvider)
```

The address provider contract.

#### 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   |

### claimERC3525Rewards

```solidity
function claimERC3525Rewards(address[] _erc3525s, uint256[] _tokenIds) external nonpayable
```

Claims rewards for ERC3525 tokens.

#### Parameters

| Name       | Type       | Description                                                     |
| ---------- | ---------- | --------------------------------------------------------------- |
| \_erc3525s | address\[] | The addresses of the ERC3525 tokens for which to claim rewards. |
| \_tokenIds | uint256\[] | The token IDs for which to claim rewards.                       |

### deployNewVault

<pre class="language-solidity"><code class="lang-solidity"><strong>function deployNewVault(string _name, string _symbol, address _asset, uint256 _strategy, uint256 _bufferSize, uint256 _creatorFees, uint256 _harvestFees, string _ipfsHash) external nonpayable
</strong></code></pre>

Deploys a new vault with the specified parameters.

*This function calls the factory contract to create a new vault.*

#### Parameters

| Name          | Type    | Description                                                      |
| ------------- | ------- | ---------------------------------------------------------------- |
| \_name        | string  | The name of the new vault.                                       |
| \_symbol      | string  | The symbol of the new vault.                                     |
| \_asset       | address | The address of the asset token for the vault.                    |
| \_strategy    | uint256 | The identifier for the strategy to be used by the vault.         |
| \_bufferSize  | uint256 | The size of the buffer for the vault.                            |
| \_creatorFees | uint256 | The fees to be paid to the creator of the vault.                 |
| \_harvestFees | uint256 | The fees to be paid for harvesting the vault.                    |
| \_ipfsHash    | string  | The IPFS hash containing additional information about the vault. |

### editVaultParams

```solidity
function editVaultParams(address _vault, enum IStrategVault.StrategVaultSettings[] settings, bytes[] data) external nonpayable
```

Edits the parameters of an existing vault.

#### Parameters

| Name     | Type                                       | Description                                                         |
| -------- | ------------------------------------------ | ------------------------------------------------------------------- |
| \_vault  | address                                    | The address of the vault to be edited.                              |
| settings | enum IStrategVault.StrategVaultSettings\[] | An array of StrategVaultSettings indicating which settings to edit. |
| data     | bytes\[]                                   | An array of bytes data corresponding to each setting in `settings`. |

### executeVaultParamsEdit

```solidity
function executeVaultParamsEdit(address _vault, uint256 _index) external nonpayable
```

Edits the parameters of an existing vault.

#### Parameters

| Name    | Type    | Description                                                         |
| ------- | ------- | ------------------------------------------------------------------- |
| \_vault | address | The address of the vault to be edited.                              |
| \_index | uint256 | An array of bytes data corresponding to each setting in `settings`. |

### 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   |

### isTrustedForwarder

```solidity
function isTrustedForwarder(address _forwarder) external view returns (bool)
```

Checks if the given address is a trusted forwarder.

*Overrides the ERC2771Context isTrustedForwarder function to utilize the RELAYER\_ROLE.*

#### Parameters

| Name        | Type    | Description           |
| ----------- | ------- | --------------------- |
| \_forwarder | address | The address to check. |

#### Returns

| Name | Type | Description                                                      |
| ---- | ---- | ---------------------------------------------------------------- |
| \_0  | bool | bool True if the address has the RELAYER\_ROLE, false otherwise. |

### portalVaultDeposit

```solidity
function portalVaultDeposit(address _sender, address _vault, uint256 _assets, address _receiver) external nonpayable
```

Allows a user to deposit assets into a vault after a portal swap.

#### Parameters

| Name       | Type    | Description                                              |
| ---------- | ------- | -------------------------------------------------------- |
| \_sender   | address | The address of the vault where assets will be deposited. |
| \_vault    | address | The address of the vault where assets will be deposited. |
| \_assets   | uint256 | The amount of assets to deposit.                         |
| \_receiver | address | The vault shares receiver                                |

### 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   |

### setVaultStrategy

```solidity
function setVaultStrategy(address vault, address[] _positionManagers, address[] _stratBlocks, bytes[] _stratBlocksParameters, bool[] _isFinalBlock, address[] _harvestBlocks, bytes[] _harvestBlocksParameters) external nonpayable
```

Sets the strategy for a given vault.

*This function configures the strategy for a vault by specifying position managers, strategy blocks, their parameters, and harvest blocks.*

#### Parameters

| Name                      | Type       | Description                                                                                                 |
| ------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |
| vault                     | address    | The address of the vault for which the strategy is being set.                                               |
| \_positionManagers        | address\[] | An array of addresses for the position managers associated with the strategy.                               |
| \_stratBlocks             | address\[] | An array of addresses for the strategy blocks to be used in the strategy.                                   |
| \_stratBlocksParameters   | bytes\[]   | An array of bytes representing the parameters for each strategy block.                                      |
| \_isFinalBlock            | bool\[]    | An array of booleans indicating whether each corresponding strategy block is a final block in the strategy. |
| \_harvestBlocks           | address\[] | An array of addresses for the harvest blocks to be used in the strategy.                                    |
| \_harvestBlocksParameters | bytes\[]   | An array of bytes representing the parameters for each harvest block.                                       |

### vaultDeposit

```solidity
function vaultDeposit(address _vault, uint256 _assets, address _receiver, bytes _permitParams) external nonpayable
```

Allows a user to deposit assets into a vault.

#### Parameters

| Name           | Type    | Description                                                                            |
| -------------- | ------- | -------------------------------------------------------------------------------------- |
| \_vault        | address | The address of the vault where assets will be deposited.                               |
| \_assets       | uint256 | The amount of assets to deposit.                                                       |
| \_receiver     | address | undefined                                                                              |
| \_permitParams | bytes   | The permit parameters for approving the vault to spend assets on behalf of the sender. |

### vaultRedeem

```solidity
function vaultRedeem(address _vault, uint256 _shares, bytes _permitParams) external nonpayable
```

Redeems shares from the vault and sends the underlying assets to the sender.

#### Parameters

| Name           | Type    | Description                                                                            |
| -------------- | ------- | -------------------------------------------------------------------------------------- |
| \_vault        | address | The address of the vault from which to redeem shares.                                  |
| \_shares       | uint256 | The amount of shares to redeem.                                                        |
| \_permitParams | bytes   | The permit parameters for approving the vault to spend shares on behalf of the sender. |

### vaultWithdrawalRebalance

```solidity
function vaultWithdrawalRebalance(address _vault, uint256 _deadline, uint256 _amount, bytes _signature, bytes _portalPayload, bytes _permitParams, uint256[] _dynParamsIndexExit, bytes[] _dynParamsExit) external payable returns (uint256 returnedAssets)
```

Performs a withdrawal rebalance operation on the vault.

#### Parameters

| Name                 | Type       | Description                                                                            |
| -------------------- | ---------- | -------------------------------------------------------------------------------------- |
| \_vault              | address    | The address of the vault to perform the withdrawal rebalance on.                       |
| \_deadline           | uint256    | The deadline by which the operation must be completed.                                 |
| \_amount             | uint256    | The amount to withdraw from the vault.                                                 |
| \_signature          | bytes      | The signature for permit-based withdrawals.                                            |
| \_portalPayload      | bytes      | The payload for interacting with external protocols during the rebalance.              |
| \_permitParams       | bytes      | The permit parameters for approving the vault to spend tokens on behalf of the sender. |
| \_dynParamsIndexExit | uint256\[] | Dynamic parameters index for exiting strategies.                                       |
| \_dynParamsExit      | bytes\[]   | Dynamic parameters for exiting strategies.                                             |

#### Returns

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| returnedAssets | uint256 | undefined   |

## Events

### AuthorityUpdated

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

*Authority that manages this contract was updated.*

#### Parameters

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

## 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   |

### AddressEmptyCode

```solidity
error AddressEmptyCode(address target)
```

*There's no code at `target` (it is not a contract).*

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| target | address | undefined   |

### AddressInsufficientBalance

```solidity
error AddressInsufficientBalance(address account)
```

*The ETH balance of the account is not enough to perform the operation.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### BadInput

```solidity
error BadInput()
```

Triggered when functions inputs are invalid

### FailedInnerCall

```solidity
error FailedInnerCall()
```

*A call to an address target failed. The target may have reverted.*

### NotPortal

```solidity
error NotPortal()
```

Triggered when function caller is not the portal

### SafeERC20FailedOperation

```solidity
error SafeERC20FailedOperation(address token)
```

*An operation with an ERC20 token failed.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| token | address | undefined   |
