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
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
_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
_type
uint256
undefined
getOwnedPositionManagerBy
function getOwnedPositionManagerBy(address owner) external view returns (address[])
Parameters
owner
address
undefined
Returns
_0
address[]
undefined
isPositionManager
function isPositionManager(address) external view returns (bool)
Parameters
_0
address
undefined
Returns
_0
bool
undefined
positionManagerLength
function positionManagerLength() external view returns (uint256)
Total number of position managers created
Returns
_0
uint256
undefined
positionManagerTypeLength
function positionManagerTypeLength() external view returns (uint256)
Total number of position manager types available
Returns
_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
_0
uint256
undefined
Returns
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
_0
uint256
undefined
Returns
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
newOwner
address
undefined
upgradePositionManagerType
function upgradePositionManagerType(uint256 _type, address _implementation, address _info) external nonpayable
Parameters
_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
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
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
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
PositionManagerTypeDisabled
event PositionManagerTypeDisabled(uint256 index)
Emitted when a Position Manager Type is disabled.
Parameters
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
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
owner
address
undefined
OwnableUnauthorizedAccount
error OwnableUnauthorizedAccount(address account)
The caller account is not authorized to perform an operation.
Parameters
account
address
undefined
Last updated