# Set Token

BEP20 Token contract that allows privileged modules to make modifications to its positions and invoke function calls from the SetToken.&#x20;

### Select View Methods <a href="#select-view-methods" id="select-view-methods"></a>

#### manager() <a href="#manager" id="manager"></a>

`function manager() view returns (address)`Returns the manager of the SetToken.

| Return Name | Type    | Description                       |
| ----------- | ------- | --------------------------------- |
| manager     | address | Address of the SetToken's manager |

#### getModules() <a href="#getmodules" id="getmodules"></a>

`function getModules() external view returns (address[] memory)`Returns the list of modules a SetToken has enabled.

| Return Name | Type       | Description             |
| ----------- | ---------- | ----------------------- |
| modules     | address\[] | List of enabled modules |

#### getPositions() <a href="#getpositions" id="getpositions"></a>

`function getPositions() public view returns (ISetToken.Position[] memory)`

Retrieves the positions in an array from the SetToken. A position definition is as follows:

```javascript
    /**
     * The base definition of a SetToken Position
     *
     * @param component           Address of token in the Position
     * @param module              If not in default state, the address of associated module
     * @param unit                Each unit is the # of components per 10^18 of a SetToken
     * @param positionState       The type of position denoted as a uint8
     * @param data                Arbitrary data
     */
    struct Position {
        address component;
        address module;
        int256 unit;
        uint8 positionState;
        bytes data;
    }
```

| Return Name | Type        | Description       |
| ----------- | ----------- | ----------------- |
| positions   | Position\[] | List of positions |

#### getComponents() <a href="#getcomponents" id="getcomponents"></a>

`function getComponents() public view returns (address[] memory)`Returns the list of component assets in the SetToken.

| Return Name | Type       | Description        |
| ----------- | ---------- | ------------------ |
| components  | address\[] | List of components |

#### getDefaultPositionRealUnit() <a href="#getdefaultpositionrealunit" id="getdefaultpositionrealunit"></a>

`function getDefaultPositionRealUnit(address _component) external view returns (int256)`Returns the component real unit of a `Default` position.

| Parameter Name | Type    | Description                    |
| -------------- | ------- | ------------------------------ |
| \_component    | address | Address of the component asset |

| Return Name   | Type      | Description                                          |
| ------------- | --------- | ---------------------------------------------------- |
| componentUnit | int256\[] | Position real unit of the component (signed integer) |

#### getExternalPositionRealUnit() <a href="#getexternalpositionrealunit" id="getexternalpositionrealunit"></a>

`function getExternalPositionRealUnit(address _component, address _positionModule) public view returns(int256)`Returns the component real unit of an `External` position.

| Parameter Name   | Type    | Description                                     |
| ---------------- | ------- | ----------------------------------------------- |
| \_component      | address | Address of the component asset                  |
| \_positionModule | address | Module the external position is associated with |

| Return Name   | Type      | Description                                          |
| ------------- | --------- | ---------------------------------------------------- |
| componentUnit | int256\[] | Position real unit of the component (signed integer) |

#### getTotalComponentRealUnits() <a href="#getexternalpositionrealunit-1" id="getexternalpositionrealunit-1"></a>

`function getTotalComponentRealUnits(address _component) external view returns(int256)`‌Returns the total component real units of a position, summing the `Default` and `External`.

| Parameter Name | Type    | Description                    |
| -------------- | ------- | ------------------------------ |
| \_component    | address | Address of the component asset |

| Return Name   | Type      | Description                                          |
| ------------- | --------- | ---------------------------------------------------- |
| componentUnit | int256\[] | Position real unit of the component (signed integer) |
