> 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/borrow-module/smart-contract-docs/strategpositionmanagerfactory.md).

# StrategPositionManagerFactory

Factory contract for creating and managing Strateg Position Managers. It allows the deployment of new position managervand the  management of position manager types

## Methods

### addNewPositionManagerType

```solidity
function addNewPositionManagerType(string name, address implementation, address info) external nonpayable
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| name           | string  | undefined   |
| implementation | address | undefined   |
| info           | address | undefined   |

### deployNewPositionManagers

```solidity
function deployNewPositionManagers(address _owner, uint256[] _types, uint256[] _blockIndexes, address[] _collaterals, address[] _borroweds, bytes[] _params) external nonpayable
```

Deploys new position managers based on the specified types and initializes them with the provided parameters.

*This function creates new position managers, initializes them, and emits a NewPositionManager event for each.*

#### Parameters

| Name           | Type       | Description                                                                                |
| -------------- | ---------- | ------------------------------------------------------------------------------------------ |
| \_owner        | address    | The owner of the new position managers.                                                    |
| \_types        | uint256\[] | An array of position manager types. Each type corresponds to a PositionManagerType struct. |
| \_blockIndexes | uint256\[] | An array of block indexes for the position managers. Used during initialization.           |
| \_collaterals  | address\[] | An array of collateral addresses for the position managers.                                |
| \_borroweds    | address\[] | An array of borrowed asset addresses for the position managers.                            |
| \_params       | bytes\[]   | An array of bytes containing initialization parameters for each position manager.          |

### disablePositionManagerType

```solidity
function disablePositionManagerType(uint256 _type) external nonpayable
```

#### Parameters

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

### getOwnedPositionManagerBy

```solidity
function getOwnedPositionManagerBy(address owner) external view returns (address[])
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

#### Returns

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

### isPositionManager

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

#### Parameters

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

#### Returns

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

### positionManagerLength

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

Total number of position managers created

#### Returns

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

### positionManagerTypeLength

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

Total number of position manager types available

#### Returns

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

### positionManagerTypes

```solidity
function positionManagerTypes(uint256) external view returns (string name, address implementation, address info, uint256 version)
```

Mapping from type ID to PositionManagerType details

#### Parameters

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

#### Returns

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| name           | string  | undefined   |
| implementation | address | undefined   |
| info           | address | undefined   |
| version        | uint256 | undefined   |

### positionManagers

```solidity
function positionManagers(uint256) external view returns (address owner, address addr, address info, uint256 pmType)
```

Mapping from position manager ID to PositionManager details

#### Parameters

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

#### Returns

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| owner  | address | undefined   |
| addr   | address | undefined   |
| info   | address | undefined   |
| pmType | uint256 | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### upgradePositionManagerType

```solidity
function upgradePositionManagerType(uint256 _type, address _implementation, address _info) external nonpayable
```

#### Parameters

| Name             | Type    | Description |
| ---------------- | ------- | ----------- |
| \_type           | uint256 | undefined   |
| \_implementation | address | undefined   |
| \_info           | address | undefined   |

## Events

### NewPositionManager

```solidity
event NewPositionManager(uint256 index, address owner, uint256 pmType, address collateral, address borrowed, address addr, address info)
```

*Emitted when a new Position Manager is created.*

#### Parameters

| Name       | Type    | Description                                                                |
| ---------- | ------- | -------------------------------------------------------------------------- |
| index      | uint256 | The index of the new Position Manager.                                     |
| owner      | address | The address of the owner of the new Position Manager.                      |
| pmType     | uint256 | The type of the new Position Manager.                                      |
| collateral | address | The address of the collateral token for the new Position Manager.          |
| borrowed   | address | The address of the borrowed token for the new Position Manager.            |
| addr       | address | The address of the new Position Manager.                                   |
| info       | address | The address of the info contract associated with the new Position Manager. |

### NewPositionManagerType

```solidity
event NewPositionManagerType(uint256 index, string name, address implementation, address info, uint256 version)
```

*Emitted when a new Position Manager Type is added.*

#### Parameters

| Name           | Type    | Description                                                                     |
| -------------- | ------- | ------------------------------------------------------------------------------- |
| index          | uint256 | The index of the new Position Manager Type.                                     |
| name           | string  | The name of the new Position Manager Type.                                      |
| implementation | address | The address of the implementation of the new Position Manager Type.             |
| info           | address | The address of the info contract associated with the new Position Manager Type. |
| version        | uint256 | The version of the new Position Manager Type.                                   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### PositionManagerTypeDisabled

```solidity
event PositionManagerTypeDisabled(uint256 index)
```

*Emitted when a Position Manager Type is disabled.*

#### Parameters

| Name  | Type    | Description                                      |
| ----- | ------- | ------------------------------------------------ |
| index | uint256 | The index of the disabled Position Manager Type. |

### PositionManagerTypeUpdated

```solidity
event PositionManagerTypeUpdated(uint256 index, address implementation, address info, uint256 version)
```

*Emitted when an existing Position Manager Type is updated.*

#### Parameters

| Name           | Type    | Description                                                                             |
| -------------- | ------- | --------------------------------------------------------------------------------------- |
| index          | uint256 | The index of the updated Position Manager Type.                                         |
| implementation | address | The new address of the implementation of the updated Position Manager Type.             |
| info           | address | The new address of the info contract associated with the updated Position Manager Type. |
| version        | uint256 | The new version of the updated Position Manager Type.                                   |

## Errors

### ERC1167FailedCreateClone

```solidity
error ERC1167FailedCreateClone()
```

*A clone instance deployment failed.*

### InvalidPositionManagerType

```solidity
error InvalidPositionManagerType()
```

returned when the Position Manager Type is invalid.

### NotOwner

```solidity
error NotOwner()
```

returned when the caller is not the owner of the Position Manager.

### OwnableInvalidOwner

```solidity
error OwnableInvalidOwner(address owner)
```

*The owner is not a valid owner account. (eg. `address(0)`)*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

### OwnableUnauthorizedAccount

```solidity
error OwnableUnauthorizedAccount(address account)
```

*The caller account is not authorized to perform an operation.*

#### Parameters

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