> For the complete documentation index, see [llms.txt](https://docs.libertum.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.libertum.io/developers/contracts/position-manager/isecuritytokenpositionmanager.sol.md).

# ISecurityTokenPositionManager.sol

## ISecurityTokenPositionManager

[Git Source](https://github.com/Libertum-Project/security-token-contracts/blob/3464d5ab8850f3f8fc835299f95703c8793378ae/src\position\ISecurityTokenPositionManager.sol)

Interface for managing positions in security tokens

*This interface defines the core functionality for minting, burning, and managing security token positions*

### Functions

#### initializeAuthority

Initializes the authority for the position manager

*This function should only be called once, typically during contract deployment*

```solidity
function initializeAuthority(address initialAuthority) external;
```

**Parameters**

| Name               | Type      | Description                                    |
| ------------------ | --------- | ---------------------------------------------- |
| `initialAuthority` | `address` | The address to be set as the initial authority |

#### initialize

Initializes the position manager and its associated ERC721 token

```solidity
function initialize(string calldata name, string calldata symbol, address descriptor) external;
```

**Parameters**

| Name         | Type      | Description                                            |
| ------------ | --------- | ------------------------------------------------------ |
| `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

```solidity
function updateSecurityToken(address securityToken, SecurityTokenDetails calldata details) external;
```

**Parameters**

| Name            | Type                   | Description                                 |
| --------------- | ---------------------- | ------------------------------------------- |
| `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

```solidity
function removeSecurityToken(address securityToken) external;
```

**Parameters**

| Name            | Type      | Description                                 |
| --------------- | --------- | ------------------------------------------- |
| `securityToken` | `address` | The address of the security token to remove |

#### setDefaultRoyalty

Sets the default royalty for the contract

```solidity
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;
```

**Parameters**

| Name           | Type      | Description                                 |
| -------------- | --------- | ------------------------------------------- |
| `receiver`     | `address` | The address to receive royalties            |
| `feeNumerator` | `uint96`  | The fee numerator for calculating royalties |

#### setTokenRoyalty

Sets the royalty for a specific token

```solidity
function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external;
```

**Parameters**

| Name           | Type      | Description                                 |
| -------------- | --------- | ------------------------------------------- |
| `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

```solidity
function mint(address securityToken, uint256 amount, address recipient, bytes memory data)
    external
    returns (uint256 tokenId);
```

**Parameters**

| Name            | Type      | Description                                                    |
| --------------- | --------- | -------------------------------------------------------------- |
| `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**

| Name      | Type      | Description                               |
| --------- | --------- | ----------------------------------------- |
| `tokenId` | `uint256` | The ID of the newly minted position token |

#### burn

Burns a position and releases the locked security tokens

```solidity
function burn(uint256 tokenId, address recipient) external returns (TokenData memory data);
```

**Parameters**

| Name        | Type      | Description                                           |
| ----------- | --------- | ----------------------------------------------------- |
| `tokenId`   | `uint256` | The ID of the position to burn                        |
| `recipient` | `address` | The address to receive the underlying security tokens |

**Returns**

| Name   | Type        | Description                          |
| ------ | ----------- | ------------------------------------ |
| `data` | `TokenData` | The TokenData of the burned position |

#### setDelegate

Sets the delegate for a position's voting power

```solidity
function setDelegate(uint256 tokenId, address target) external;
```

**Parameters**

| Name      | Type      | Description                     |
| --------- | --------- | ------------------------------- |
| `tokenId` | `uint256` | The ID of the position token    |
| `target`  | `address` | The address of the new delegate |

#### securityTokenDetails

Retrieves the details of a security token

```solidity
function securityTokenDetails(address securityToken) external view returns (SecurityTokenDetails memory);
```

**Parameters**

| Name            | Type      | Description                       |
| --------------- | --------- | --------------------------------- |
| `securityToken` | `address` | The address of the security token |

**Returns**

| Name     | Type                   | Description                                              |
| -------- | ---------------------- | -------------------------------------------------------- |
| `<none>` | `SecurityTokenDetails` | The SecurityTokenDetails of the specified security token |

#### tokenData

Retrieves the token data for a position

```solidity
function tokenData(uint256 tokenId) external view returns (TokenData memory);
```

**Parameters**

| Name      | Type      | Description                  |
| --------- | --------- | ---------------------------- |
| `tokenId` | `uint256` | The ID of the position token |

**Returns**

| Name     | Type        | Description                             |
| -------- | ----------- | --------------------------------------- |
| `<none>` | `TokenData` | The TokenData of the specified position |

### Events

#### Mint

Emitted when a new position is minted

```solidity
event Mint(
    uint256 indexed tokenId,
    address indexed securityToken,
    uint256 indexed amount,
    address container,
    address recipient,
    address sender
);
```

**Parameters**

| Name            | Type      | Description                                  |
| --------------- | --------- | -------------------------------------------- |
| `tokenId`       | `uint256` | The unique identifier of the minted position |
| `securityToken` | `address` | The address of the security token            |
| `amount`        | `uint256` | The amount of tokens in the position         |
| `container`     | `address` | The address of the votes container           |
| `recipient`     | `address` | The address receiving the minted position    |
| `sender`        | `address` | The address initiating the mint              |

#### Burn

Emitted when a position is burned

```solidity
event Burn(
    uint256 indexed tokenId, address indexed securityToken, uint256 indexed amount, address recipient, address sender
);
```

**Parameters**

| Name            | Type      | Description                                  |
| --------------- | --------- | -------------------------------------------- |
| `tokenId`       | `uint256` | The unique identifier of the burned position |
| `securityToken` | `address` | The address of the security token            |
| `amount`        | `uint256` | The amount of tokens in the burned position  |
| `recipient`     | `address` | The address receiving the underlying tokens  |
| `sender`        | `address` | The address initiating the burn              |

#### UpdateSecurityToken

Emitted when a security token is updated

```solidity
event UpdateSecurityToken(address indexed securityToken);
```

**Parameters**

| Name            | Type      | Description                               |
| --------------- | --------- | ----------------------------------------- |
| `securityToken` | `address` | The address of the updated security token |

#### RemoveSecurityToken

Emitted when a security token is removed

```solidity
event RemoveSecurityToken(address indexed securityToken);
```

**Parameters**

| Name            | Type      | Description                               |
| --------------- | --------- | ----------------------------------------- |
| `securityToken` | `address` | The address of the removed security token |

### Structs

#### TokenData

Struct representing token data for a position

```solidity
struct TokenData {
    address securityToken;
    uint256 amount;
    address container;
}
```

**Properties**

| Name            | Type      | Description                          |
| --------------- | --------- | ------------------------------------ |
| `securityToken` | `address` | The address of the security token    |
| `amount`        | `uint256` | The amount of tokens in the position |
| `container`     | `address` | The address of the votes container   |

#### SecurityTokenDetails

Struct representing details of a security token

```solidity
struct SecurityTokenDetails {
    bytes data;
}
```

**Properties**

| Name   | Type    | Description                                        |
| ------ | ------- | -------------------------------------------------- |
| `data` | `bytes` | Additional data associated with the security token |
