> For the complete documentation index, see [llms.txt](https://docs.bool.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bool.network/evm-ecosystem/smart-contracts/primary-contracts/interfaces/ianchorfactory.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bool.network/evm-ecosystem/smart-contracts/primary-contracts/interfaces/ianchorfactory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
