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
  • addNewPositionManagerType
  • deployNewPositionManagers
  • disablePositionManagerType
  • getOwnedPositionManagerBy
  • isPositionManager
  • positionManagerLength
  • positionManagerTypeLength
  • positionManagerTypes
  • positionManagers
  • renounceOwnership
  • transferOwnership
  • upgradePositionManagerType
  • Events
  • NewPositionManager
  • NewPositionManagerType
  • OwnershipTransferred
  • PositionManagerTypeDisabled
  • PositionManagerTypeUpdated
  • Errors
  • ERC1167FailedCreateClone
  • InvalidPositionManagerType
  • NotOwner
  • OwnableInvalidOwner
  • OwnableUnauthorizedAccount
  1. Borrow module
  2. Smart Contract Docs

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

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

Parameters

Name
Type
Description

name

string

undefined

implementation

address

undefined

info

address

undefined

deployNewPositionManagers

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

function disablePositionManagerType(uint256 _type) external nonpayable

Parameters

Name
Type
Description

_type

uint256

undefined

getOwnedPositionManagerBy

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

Parameters

Name
Type
Description

owner

address

undefined

Returns

Name
Type
Description

_0

address[]

undefined

isPositionManager

function isPositionManager(address) external view returns (bool)

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

positionManagerLength

function positionManagerLength() external view returns (uint256)

Total number of position managers created

Returns

Name
Type
Description

_0

uint256

undefined

positionManagerTypeLength

function positionManagerTypeLength() external view returns (uint256)

Total number of position manager types available

Returns

Name
Type
Description

_0

uint256

undefined

positionManagerTypes

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

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

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

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

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

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

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

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

Name
Type
Description

previousOwner indexed

address

undefined

newOwner indexed

address

undefined

PositionManagerTypeDisabled

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

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

error ERC1167FailedCreateClone()

A clone instance deployment failed.

InvalidPositionManagerType

error InvalidPositionManagerType()

returned when the Position Manager Type is invalid.

NotOwner

error NotOwner()

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

OwnableInvalidOwner

error OwnableInvalidOwner(address owner)

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

Parameters

Name
Type
Description

owner

address

undefined

OwnableUnauthorizedAccount

error OwnableUnauthorizedAccount(address account)

The caller account is not authorized to perform an operation.

Parameters

Name
Type
Description

account

address

undefined

PreviousSmart Contract DocsNextStrategAaveV3PositionManager

Last updated 1 year ago