Skip to main content

PositionManager.sol

Read code on GitHub

Wraps the positions into ERC1155 tokens

Methods

DOMAIN_SEPARATOR

Returns the domain separator

Solidity
function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32Hash of the domain separator

WETH9

Returns the address of WETH9

Solidity
function WETH9() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

balanceOf

Solidity
function balanceOf(address account, uint256 id) external view returns (uint256)
Details

See {IERC1155-balanceOf}. Requirements: - account cannot be the zero address.

Parameters

NameTypeDescription
accountaddressundefined
iduint256undefined

Returns

NameTypeDescription
_0uint256undefined

balanceOfBatch

Solidity
function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])
Details

See {IERC1155-balanceOfBatch}. Requirements: - accounts and ids must have the same length.

Parameters

NameTypeDescription
accountsaddress[]undefined
idsuint256[]undefined

Returns

NameTypeDescription
_0uint256[]undefined

factory

Returns the address of the factory

Solidity
function factory() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

isApprovedForAll

Solidity
function isApprovedForAll(address account, address operator) external view returns (bool)
Details

See {IERC1155-isApprovedForAll}.

Parameters

NameTypeDescription
accountaddressundefined
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

nonces

Returns the current nonce of an address

Solidity
function nonces(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

permit

Grants or revokes the approval for an operator to transfer any of the owner's tokens using their signature

Solidity
function permit(address owner, address operator, bool approved, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable

Parameters

NameTypeDescription
owneraddressAddress of the owner
operatoraddressAddress of the operator
approvedboolTrue if the approval should be granted, false if revoked
deadlineuint256Expiry of the signature, as a timestamp
vuint8Must produce valid secp256k1 signature from the holder along with r and s
rbytes32Must produce valid secp256k1 signature from the holder along with v and s
sbytes32Must produce valid secp256k1 signature from the holder along with r and v

positionDescriptor

Returns the address of the PositionDescriptor

Solidity
function positionDescriptor() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

safeBatchTransferFrom

Solidity
function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable
Details

See {IERC1155-safeBatchTransferFrom}.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
idsuint256[]undefined
amountsuint256[]undefined
databytesundefined

safeTransferFrom

Solidity
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable
Details

See {IERC1155-safeTransferFrom}.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
iduint256undefined
amountuint256undefined
databytesundefined

setApprovalForAll

Solidity
function setApprovalForAll(address operator, bool approved) external nonpayable
Details

See {IERC1155-setApprovalForAll}.

Parameters

NameTypeDescription
operatoraddressundefined
approvedboolundefined

supportsInterface

Solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
Details

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

uri

Returns the metadata of a token

Solidity
function uri(uint256 tokenId) external view returns (string)

Parameters

NameTypeDescription
tokenIduint256Token id to look for (same as pool id)

Returns

NameTypeDescription
_0stringMetadata of the token as a string

Events

ApprovalForAll

Solidity
event ApprovalForAll(address indexed account, address indexed operator, bool approved)

Parameters

NameTypeDescription
account indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

TransferBatch

Solidity
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
idsuint256[]undefined
valuesuint256[]undefined

TransferSingle

Solidity
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
iduint256undefined
valueuint256undefined

URI

Solidity
event URI(string value, uint256 indexed id)

Parameters

NameTypeDescription
valuestringundefined
id indexeduint256undefined

Errors

InvalidSigError

Thrown when the signature is invalid

Solidity
error InvalidSigError()

LockedError

Thrown when a call to the contract is made during a locked state

Solidity
error LockedError()

NotEngineError

Thrown when the sender is not a Primitive Engine contract

Solidity
error NotEngineError()

SigExpiredError

Thrown when the signature has expired

Solidity
error SigExpiredError()

WrongConstructorParametersError

Thrown when the constructor parameters are wrong

Solidity
error WrongConstructorParametersError()