> For the complete documentation index, see [llms.txt](https://docs.nftx.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nftx.io/art-blocks/wrapper-factory.md).

# Wrapper Factory

ArtBlocksWrapperFactory — the curated core registry, permissionless wrapper deployment, and predicting a wrapper's address before it exists.

`ArtBlocksWrapperFactory` deploys one [project wrapper](https://docs.nftx.io/art-blocks/project-wrapper.md) per `(core, projectId)` pair and keeps the registry of Art Blocks cores those wrappers may be built from.

|         |                                              |
| ------- | -------------------------------------------- |
| Address | `0x60BDb946Fc17C10210d2e8e6DC3bc3f5415989FC` |
| Chain   | Ethereum Mainnet only                        |

## Deploying a wrapper

### `deployWrapper`

```solidity
function deployWrapper(address _core, uint _projectId) returns (address wrapper_);
```

Permissionless for any registered core, and one-time per project — a second call for the same pair reverts, because the wrapper already exists. Each wrapper is a minimal-proxy clone of a shared implementation, so deployment is cheap no matter how many projects get wrapped.

Reverts with `CoreNotRegistered` if the core is not on the registry below.

### `getWrapper`

```solidity
function getWrapper(address _core, uint _projectId)
  returns (address wrapper_, bool deployed_);
```

Wrapper addresses are deterministic — CREATE2, salted by the `(core, projectId)` pair — so this resolves the address a project's wrapper *will* occupy whether or not anyone has deployed it yet.

{% hint style="danger" %}
**Always check `deployed_` before you use `wrapper_`.** The address is returned either way. Sending tokens to a wrapper that does not exist yet sends them to an account with no code, and they are not recoverable.
{% endhint %}

### `getWrapperForToken`

```solidity
function getWrapperForToken(address _core, uint _tokenId)
  returns (address wrapper_, bool deployed_, uint projectId_);
```

The same lookup when you are holding a token rather than a project number. It derives the project from the token ID for you (`_tokenId / 1_000_000`) and returns it alongside the wrapper. The same `deployed_` caveat applies.

### `wrappersCount`

```solidity
function wrappersCount() returns (uint count_);
```

How many wrappers the factory has deployed in total.

## Registered cores

The factory will only build wrappers for cores on its registry. This is the one part of the system with an owner, and its reach is narrow by design: it decides which cores *may be wrapped in future*, and nothing else.

| Core                                      | Address                                      |
| ----------------------------------------- | -------------------------------------------- |
| AB Core V0 (projects 0–2)                 | `0x059EDD72Cd353dF5106D2B9cC5ab83a52287aC3a` |
| AB Core V1 (projects 3–373)               | `0xa7d8d9ef8D8Ce8992Df33D8b8CF4Aebabd5bD270` |
| AB Core V3 (projects 374–493)             | `0x99a9B7c1116f9ceEB1652de04d5969CcE509B069` |
| AB Core V3.2 (projects 494–504)           | `0xAB0000000000aa06f89B268D604a9c1C41524Ac6` |
| AB Core V3.2 Flex Onchain (projects 505+) | `0xAB00000000002ADE39f58F9D8278a31574fFBe77` |

These are the Art Blocks **flagship** cores. Engine and Studio cores are out of scope for now — not because they cannot work, but because we have deliberately kept the initial registry to the flagship set. Any core can be added later with a single `registerCores` call.

### `registerCores` / `unregisterCore`

```solidity
function registerCores(address[] calldata _cores);   // owner only
function unregisterCore(address _core);              // owner only
```

Unregistering a core stops *new* wrappers being deployed from it. It does nothing to wrappers that already exist, and nothing to the tokens they hold — existing wrappers keep working, and holders can keep wrapping and unwrapping exactly as before. There is no route from the factory's owner to anyone's custody.

## Events

| Event                                                                                                             | Fired when                      |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `WrapperDeployed(address indexed _core, uint256 indexed _projectId, address indexed _wrapper, address _deployer)` | A wrapper is deployed           |
| `CoreRegistered(address indexed _core)`                                                                           | A core is added to the registry |
| `CoreUnregistered(address indexed _core)`                                                                         | A core is removed               |

All three are indexed by the NFTX subgraph, so you can read the registry's history and the full wrapper set without walking the chain yourself.
