# IAnchorFactory

## Variables

### AnchorInfo

```solidity
struct AnchorInfo {
    uint8 version;
    address anchor;
    address committee;
    address deployer;
};
```

Stores the descriptive information of an anchor. It can be fetched via `fetchInfo`.

#### Params

<table><thead><tr><th width="145.33333333333331">Name</th><th width="101">Type</th><th width="322.6666666666667">Description</th></tr></thead><tbody><tr><td><code>version</code></td><td>uint8</td><td>The version of the anchor contract</td></tr><tr><td><code>anchor</code></td><td>address</td><td>The address of the anchor</td></tr><tr><td><code>committee</code></td><td>address</td><td>The committee of the anchor</td></tr><tr><td><code>deployer</code></td><td>address</td><td>The initial deployer of the anchor</td></tr></tbody></table>

## Events

### AnchorDeployed

```solidity
event AnchorDeployed(
    address indexed deployer,
    uint32 anchorId,
    address anchor,
    address committee
);
```

Emitted when a new anchor deployed.

#### Params

<table><thead><tr><th width="147.33333333333331">Name</th><th width="100">Type</th><th width="330.6666666666667">Description</th></tr></thead><tbody><tr><td><code>deployer</code></td><td>address</td><td>The deployer of the anchor</td></tr><tr><td><code>anchorId</code></td><td>uint32</td><td>The unique identification of the anchor</td></tr><tr><td><code>anchor</code></td><td>address</td><td>The address of the anchor</td></tr><tr><td><code>committee</code></td><td>address</td><td>The committee of the anchor</td></tr></tbody></table>

## Functions

### messenger

```solidity
function messenger(
) external view returns (address)
```

Returns the messenger address on the local blockchain. Any anchor deployed through this AnchorFactory will be initially connected to this messenger.

#### Return Values

<table><thead><tr><th width="114">Type</th><th width="271">Description</th></tr></thead><tbody><tr><td>address</td><td>The address of the messenger</td></tr></tbody></table>

### totalAnchors

```solidity
function totalAnchors(
) external view returns (uint32)
```

Returns the total number of anchors which have been deployed.

#### Return Values

<table><thead><tr><th width="132">Type</th><th width="506">Description</th></tr></thead><tbody><tr><td>uint32</td><td>The total number of anchors which have been deployed via the AnchorFactory</td></tr></tbody></table>

### fetchId

```solidity
function fetchId(
    address anchor
) external view returns (uint32)
```

Returns the unique identification of the input anchor. Each identification is unique on the local blockchain and can be passed as a key to fetch the description information of the corresponding anchor.

#### Params

<table><thead><tr><th width="120.33333333333331">Name</th><th width="101">Type</th><th width="504.66666666666674">Description</th></tr></thead><tbody><tr><td><code>anchor</code></td><td>address</td><td>The address for which the unique identification will be fetched</td></tr></tbody></table>

#### Return Values

<table><thead><tr><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>uint32</td><td>The unique identification of the input anchor</td></tr></tbody></table>

### fetchInfo

```solidity
function fetchInfo(
    uint32 id
) external view returns (AnchorInfo memory)
```

Returns the description information of the anchor with the input identification.

#### Params

<table><thead><tr><th width="98.33333333333331">Name</th><th width="82">Type</th><th width="416.66666666666674">Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>uint32</td><td>The unique identification for which the description information will be fetched</td></tr></tbody></table>
