# Registry

## Overview

`ERC6551Registry` is a contract that facilitates the creation of ERC6551 accounts using the `Create2` opcode for deterministic address generation. It allows users to deploy new accounts with specific implementation details and initialization data.

## Methods

## <mark style="color:blue;">`createAccount`</mark>

Creates a new ERC6551 account.

### Parameters

| Name             | Type      | Description                          |
| ---------------- | --------- | ------------------------------------ |
| `implementation` | `address` | The contract implementation address. |
| `chainId`        | `uint256` | Chain ID.                            |
| `tokenContract`  | `address` | Token contract address.              |
| `tokenId`        | `uint256` | Token ID.                            |
| `salt`           | `uint256` | Salt for address generation.         |
| `initData`       | `bytes`   | Initialization data for the account. |

### Returns

`address` - The address of the newly created account.

## <mark style="color:blue;">`account`</mark>

Computes the address of an ERC6551 account.

### Parameters

| Name             | Type      | Description                          |
| ---------------- | --------- | ------------------------------------ |
| `implementation` | `address` | The contract implementation address. |
| `chainId`        | `uint256` | Chain ID.                            |
| `tokenContract`  | `address` | Token contract address.              |
| `tokenId`        | `uint256` | Token ID.                            |
| `salt`           | `uint256` | Salt for address generation.         |

### Returns

`address` - The computed account address.


---

# Agent Instructions: 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:

```
GET https://docs.volary.io/template-library/smart-contracts/erc6551/registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
