SecurityTokenPositionManager.sol
SecurityTokenPositionManager
Inherits: ISecurityTokenPositionManager, ISecurityTokenPositionManagerErrors, ERC721DescribableUpgradeable, ERC721TotalSupplyUpgradeable, SecurityTokenPositionManagerStorage, ERC721RoyaltyUpgradeable, MulticallUpgradeable, AccessManagedUpgradeable
Manages positions for security tokens, allowing minting, burning, and delegation of positions
Implements ERC721 for position tokenization and includes royalty functionality
Functions
initializeAuthority
Initializes the authority for the position manager
This function should only be called once, typically during contract deployment
function initializeAuthority(address initialAuthority) external override initializer;
Parameters
initialAuthority
address
The address to be set as the initial authority
initialize
Initializes the position manager and its associated ERC721 token
function initialize(string calldata name, string calldata symbol, address descriptor) external reinitializer(2);
Parameters
name
string
The name for the ERC721 token representing positions
symbol
string
The symbol for the ERC721 token representing positions
descriptor
address
The address of the descriptor contract
updateSecurityToken
Updates the details of a security token
function updateSecurityToken(address securityToken, SecurityTokenDetails calldata details)
external
override
restricted;
Parameters
securityToken
address
The address of the security token to update
details
SecurityTokenDetails
The new details for the security token
removeSecurityToken
Removes a security token from the position manager
function removeSecurityToken(address securityToken) external override restricted;
Parameters
securityToken
address
The address of the security token to remove
setDefaultRoyalty
Sets the default royalty for the contract
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external override restricted;
Parameters
receiver
address
The address to receive royalties
feeNumerator
uint96
The fee numerator for calculating royalties
setTokenRoyalty
Sets the royalty for a specific token
function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external override restricted;
Parameters
tokenId
uint256
The ID of the token to set royalties for
receiver
address
The address to receive royalties
feeNumerator
uint96
The fee numerator for calculating royalties
mint
Mints a new position token representing a locked amount of security tokens
function mint(address securityToken, uint256 amount, address recipient, bytes memory data)
external
override
returns (uint256 tokenId);
Parameters
securityToken
address
The address of the security token to be locked in the position
amount
uint256
The amount of security tokens to be locked in the position
recipient
address
The address to receive the minted position token
data
bytes
Additional data for the mint operation
Returns
tokenId
uint256
The ID of the newly minted position token
burn
Burns a position and releases the locked security tokens
function burn(uint256 tokenId, address recipient) external override returns (TokenData memory data);
Parameters
tokenId
uint256
The ID of the position to burn
recipient
address
The address to receive the underlying security tokens
Returns
data
TokenData
The TokenData of the burned position
setDelegate
Sets the delegate for a position's voting power
function setDelegate(uint256 tokenId, address target) external override;
Parameters
tokenId
uint256
The ID of the position token
target
address
The address of the new delegate
securityTokenDetails
Retrieves the details of a security token
function securityTokenDetails(address securityToken) public view override returns (SecurityTokenDetails memory);
Parameters
securityToken
address
The address of the security token
Returns
<none>
SecurityTokenDetails
The SecurityTokenDetails of the specified security token
supportsInterface
Checks if the contract supports a given interface
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721Upgradeable, ERC721DescribableUpgradeable, ERC721RoyaltyUpgradeable)
returns (bool);
Parameters
interfaceId
bytes4
The interface identifier to check
Returns
<none>
bool
bool True if the contract supports the interface, false otherwise
tokenURI
Returns the URI for a given token
function tokenURI(uint256 tokenId)
public
view
virtual
override(ERC721Upgradeable, ERC721DescribableUpgradeable)
returns (string memory);
Parameters
tokenId
uint256
The ID of the token
Returns
<none>
string
string The URI of the token
tokenData
Retrieves the token data for a position
function tokenData(uint256 tokenId) public view override returns (TokenData memory);
Parameters
tokenId
uint256
The ID of the position token
Returns
<none>
TokenData
The TokenData of the specified position
_update
Internal function to update token ownership and delegate voting power
function _update(address to, uint256 tokenId, address auth)
internal
virtual
override(ERC721TotalSupplyUpgradeable, ERC721Upgradeable)
returns (address);
Parameters
to
address
The address to transfer ownership to
tokenId
uint256
The ID of the token being transferred
auth
address
The address authorized to make the transfer
Returns
<none>
address
address The previous owner of the token
_tokenURIData
Internal function to retrieve and encode token and security token data
function _tokenURIData(uint256 tokenId) internal view virtual override returns (bytes memory);
Parameters
tokenId
uint256
The ID of the token
Returns
<none>
bytes
bytes The ABI-encoded token data and associated security token details
Last updated