> 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/strategoperatorproxy.md).

# StrategOperatorProxy

This contract serves as a proxy for executing operations on strategy vaults. It requires the OPERATOR\_ROLE to perform the operations.

## Methods

### addressProvider

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

Mapping of vault addresses to their locked status.

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

### initialize

```solidity
function initialize(address _authority, address _addressProvider) external nonpayable
```

Initializes the contract by granting the DEFAULT\_ADMIN\_ROLE to the treasury address.

#### Parameters

| Name              | Type    | Description                        |
| ----------------- | ------- | ---------------------------------- |
| \_authority       | address | The address of the access manager. |
| \_addressProvider | address | undefined                          |

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

### lockVaults

```solidity
function lockVaults(address[] _vaults) external nonpayable
```

Locks the specified vaults, preventing any operations on them.

#### Parameters

| Name     | Type       | Description                            |
| -------- | ---------- | -------------------------------------- |
| \_vaults | address\[] | Array of vault addresses to be locked. |

### lockedVault

```solidity
function lockedVault(address) external view returns (bool)
```

Mapping of vault addresses to their locked status.

#### Parameters

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

#### Returns

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

### oracleUpdateOperation

```solidity
function oracleUpdateOperation(address[] _addresses, uint256[] _prices) external nonpayable
```

Executes price updates on portal oracle.

#### Parameters

| Name        | Type       | Description          |
| ----------- | ---------- | -------------------- |
| \_addresses | address\[] | Addresses of tokens. |
| \_prices    | uint256\[] | related prices       |

### positionManagerOperation

```solidity
function positionManagerOperation(address _positionManager, address _payer, uint256 _gasCost, bytes _payload) external nonpayable
```

Executes the rebalance function on the position manager.

#### Parameters

| Name              | Type    | Description                                               |
| ----------------- | ------- | --------------------------------------------------------- |
| \_positionManager | address | Address of the position manager.                          |
| \_payer           | address | payer for operation cost                                  |
| \_gasCost         | uint256 | gas cost to pay for operation                             |
| \_payload         | bytes   | Array of dynamic parameter indexes for exiting positions. |

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

### unlockVaults

```solidity
function unlockVaults(address[] _vaults) external nonpayable
```

Unlocks the specified vaults, allowing operations on them.

#### Parameters

| Name     | Type       | Description                              |
| -------- | ---------- | ---------------------------------------- |
| \_vaults | address\[] | Array of vault addresses to be unlocked. |

### userWithdrawalRebalancedNonce

```solidity
function userWithdrawalRebalancedNonce(address) external view returns (uint256)
```

Mapping of addresses to their respective withdrawal rebalance nonce.

#### Parameters

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

#### Returns

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

### vaultHarvest

```solidity
function vaultHarvest(address _vault, address _payer, uint256 _gasCost, uint256[] _dynParamsIndex, bytes[] _dynParams, bytes _portalPayload) external nonpayable
```

Executes the harvest function on the strategy vault.

#### Parameters

| Name             | Type       | Description                         |
| ---------------- | ---------- | ----------------------------------- |
| \_vault          | address    | Address of the strategy vault.      |
| \_payer          | address    | payer for operation cost            |
| \_gasCost        | uint256    | gas cost to pay for operation       |
| \_dynParamsIndex | uint256\[] | Array of dynamic parameter indexes. |
| \_dynParams      | bytes\[]   | Array of dynamic parameters.        |
| \_portalPayload  | bytes      | undefined                           |

### vaultRebalance

```solidity
function vaultRebalance(address _vault, address _payer, uint256 _gasCost, uint256[] _dynParamsIndexEnter, bytes[] _dynParamsEnter, uint256[] _dynParamsIndexExit, bytes[] _dynParamsExit) external nonpayable
```

Executes the rebalance function on the strategy vault.

#### Parameters

| Name                  | Type       | Description                                                |
| --------------------- | ---------- | ---------------------------------------------------------- |
| \_vault               | address    | Address of the strategy vault.                             |
| \_payer               | address    | payer for operation cost                                   |
| \_gasCost             | uint256    | gas cost to pay for operation                              |
| \_dynParamsIndexEnter | uint256\[] | Array of dynamic parameter indexes for entering positions. |
| \_dynParamsEnter      | bytes\[]   | Array of dynamic parameters for entering positions.        |
| \_dynParamsIndexExit  | uint256\[] | Array of dynamic parameter indexes for exiting positions.  |
| \_dynParamsExit       | bytes\[]   | Array of dynamic parameters for exiting positions.         |

### vaultStopStrategy

```solidity
function vaultStopStrategy(address _vault, address _payer, uint256 _gasCost, uint256[] _dynParamsIndex, bytes[] _dynParams) external nonpayable
```

Executes the harvest function on the strategy vault.

#### Parameters

| Name             | Type       | Description                         |
| ---------------- | ---------- | ----------------------------------- |
| \_vault          | address    | Address of the strategy vault.      |
| \_payer          | address    | payer for operation cost            |
| \_gasCost        | uint256    | gas cost to pay for operation       |
| \_dynParamsIndex | uint256\[] | Array of dynamic parameter indexes. |
| \_dynParams      | bytes\[]   | Array of dynamic parameters.        |

### vaultWithdrawalRebalance

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

Executes the withdrawalRebalance function on the strategy vault.

#### Parameters

| Name                 | Type       | Description                                               |
| -------------------- | ---------- | --------------------------------------------------------- |
| \_user               | address    | undefined                                                 |
| \_vault              | address    | Address of the strategy vault.                            |
| \_deadline           | uint256    | undefined                                                 |
| \_amount             | uint256    | Amount to be withdrawn.                                   |
| \_signature          | bytes      | Needed if vault need                                      |
| \_portalPayload      | bytes      | Parameters for executing a swap with returned assets.     |
| \_permitParams       | bytes      | Parameters for executing a permit (optional).             |
| \_dynParamsIndexExit | uint256\[] | Array of dynamic parameter indexes for exiting positions. |
| \_dynParamsExit      | bytes\[]   | Array of dynamic parameters for exiting positions.        |

#### Returns

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

### withdraw

```solidity
function withdraw(address[] _tokens) external nonpayable
```

Withdraws fees from the contract and transfers them to the caller.

#### Parameters

| Name     | Type       | Description                                     |
| -------- | ---------- | ----------------------------------------------- |
| \_tokens | address\[] | Array of token addresses to withdraw fees from. |

## Events

### AuthorityUpdated

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

*Authority that manages this contract was updated.*

#### Parameters

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

### Initialized

```solidity
event Initialized(uint64 version)
```

*Triggered when the contract has been initialized or reinitialized.*

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| version | uint64 | undefined   |

### PositionManagerRebalanced

```solidity
event PositionManagerRebalanced(address indexed positionManager, address payer, uint256 gasCost)
```

Emitted when a position manager is rebalanced.

#### Parameters

| Name                      | Type    | Description                                          |
| ------------------------- | ------- | ---------------------------------------------------- |
| positionManager `indexed` | address | Address of the position manager that was rebalanced. |
| payer                     | address | Address of the payer for the operation cost.         |
| gasCost                   | uint256 | Amount of gas cost paid for the operation.           |

### VaultLocked

```solidity
event VaultLocked(address indexed vault)
```

Emitted when a vault is locked.

#### Parameters

| Name            | Type    | Description                           |
| --------------- | ------- | ------------------------------------- |
| vault `indexed` | address | Address of the vault that was locked. |

### VaultStrategyHarvested

```solidity
event VaultStrategyHarvested(address indexed vault, address payer, uint256 gasCost)
```

Emitted when a strategy on a vault is harvested.

#### Parameters

| Name            | Type    | Description                                            |
| --------------- | ------- | ------------------------------------------------------ |
| vault `indexed` | address | Address of the vault where the strategy was harvested. |
| payer           | address | Address of the payer for the operation cost.           |
| gasCost         | uint256 | Amount of gas cost paid for the operation.             |

### VaultStrategyRebalanced

```solidity
event VaultStrategyRebalanced(address indexed vault, address payer, uint256 gasCost)
```

Emitted when a strategy on a vault is rebalanced.

#### Parameters

| Name            | Type    | Description                                             |
| --------------- | ------- | ------------------------------------------------------- |
| vault `indexed` | address | Address of the vault where the strategy was rebalanced. |
| payer           | address | Address of the payer for the operation cost.            |
| gasCost         | uint256 | Amount of gas cost paid for the operation.              |

### VaultStrategyStopped

```solidity
event VaultStrategyStopped(address indexed vault, address payer, uint256 gasCost)
```

Emitted when a strategy on a vault is stopped.

#### Parameters

| Name            | Type    | Description                                          |
| --------------- | ------- | ---------------------------------------------------- |
| vault `indexed` | address | Address of the vault where the strategy was stopped. |
| payer           | address | Address of the payer for the operation cost.         |
| gasCost         | uint256 | Amount of gas cost paid for the operation.           |

### VaultStrategyWithdrawalRebalanced

```solidity
event VaultStrategyWithdrawalRebalanced(address indexed vault)
```

Emitted when a withdrawal rebalance is performed on a vault.

#### Parameters

| Name            | Type    | Description                                                        |
| --------------- | ------- | ------------------------------------------------------------------ |
| vault `indexed` | address | Address of the vault where the withdrawal rebalance was performed. |

### VaultUnlocked

```solidity
event VaultUnlocked(address indexed vault)
```

Emitted when a vault is unlocked.

#### Parameters

| Name            | Type    | Description                             |
| --------------- | ------- | --------------------------------------- |
| vault `indexed` | address | Address of the vault that was unlocked. |

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

### DeadlineExceeded

```solidity
error DeadlineExceeded()
```

*Error for when an operation exceeds the specified deadline.*

### ECDSAInvalidSignature

```solidity
error ECDSAInvalidSignature()
```

*The signature derives the `address(0)`.*

### ECDSAInvalidSignatureLength

```solidity
error ECDSAInvalidSignatureLength(uint256 length)
```

*The signature has an invalid length.*

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| length | uint256 | undefined   |

### ECDSAInvalidSignatureS

```solidity
error ECDSAInvalidSignatureS(bytes32 s)
```

*The signature has an S value that is in the upper half order.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| s    | bytes32 | undefined   |

### FailedInnerCall

```solidity
error FailedInnerCall()
```

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

### InvalidInitialization

```solidity
error InvalidInitialization()
```

*The contract is already initialized.*

### NotInitializing

```solidity
error NotInitializing()
```

*The contract is not initializing.*

### OnlyUserInteraction

```solidity
error OnlyUserInteraction()
```

*Error for when an operation is restricted to user interactions only.*

### PortalExecutionFailed

```solidity
error PortalExecutionFailed(bytes data)
```

*Error for when portal execution fails.*

#### Parameters

| Name | Type  | Description                                 |
| ---- | ----- | ------------------------------------------- |
| data | bytes | Additional data about the failed execution. |

### PositionManagerOperationReverted

```solidity
error PositionManagerOperationReverted(bytes data)
```

*Error for when a position manager operation is reverted.*

#### Parameters

| Name | Type  | Description                              |
| ---- | ----- | ---------------------------------------- |
| data | bytes | Additional data about the reverted call. |

### SOPTAllowanceNotSufficient

```solidity
error SOPTAllowanceNotSufficient()
```

*Error for when the SOPT allowance is not sufficient for an operation.*

### SafeERC20FailedOperation

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

*An operation with an ERC20 token failed.*

#### Parameters

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

### VaultIsLocked

```solidity
error VaultIsLocked()
```

*Error for when an operation is attempted on a locked vault.*

### VaultRebalanceReverted

```solidity
error VaultRebalanceReverted(bytes data)
```

*Error for when a vault rebalance operation is reverted.*

#### Parameters

| Name | Type  | Description                              |
| ---- | ----- | ---------------------------------------- |
| data | bytes | Additional data about the reverted call. |
