# Welcome

NFTX v4 — a neutral fungibility layer for NFTs, rebuilt on Uniswap V4. Turn a collection into a liquid, tradable market.

**NFTX is a neutral fungibility layer for NFTs.** It gives NFT collections deep, fungible liquidity so a trade never waits on a counterparty. Deposit an NFT into a collection's pool and you get a **floor token** — an ERC-20 backed 1:1 by the pool and instantly sellable at floor value. Burn the token to redeem an NFT. Everything is non-custodial and runs on non-upgradeable contracts.

NFTX v4 is a relaunch on **Uniswap V4**. It keeps the original DNA — fungible floor liquidity — and goes further, adding a self-assessed listing system that delivers immediate liquidity across every rarity, not just the floor.

{% hint style="info" %}
This documentation is synced from GitHub. Edit the Markdown in the repository or in GitBook and the two stay in sync.
{% endhint %}

## How it works, in brief

* **Feeless entry and exit.** Depositing and redeeming NFTs is free; fees are concentrated in the listing and swap layers, not on getting in or out.
* **Floor tokens.** Each collection becomes an ERC-20 backed by its pool — so a collection can be traded, pooled, and priced like any token.
* **Liquid Listings.** List a non-floor item at a price you choose and receive a freshly minted floor token immediately; the item sells later at your price. You set the price, but the listing fee scales with how far above floor you go and for how long — so overpricing is possible, just expensive.
* **Instant swaps.** Trade ETH against a collection's floor token through its Uniswap V4 pool, or swap floor NFTs directly.

## Where to start

<table data-view="cards"><thead><tr><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Introduction</strong></td><td>New to NFTX? Start here.</td><td><a href="/getting-started/introduction">Introduction</a></td></tr><tr><td><strong>How It Works</strong></td><td>Floor tokens, Liquid Listings, swaps &#x26; trade-ups.</td><td><a href="/how-it-works/floor-tokens">Floor Tokens</a></td></tr><tr><td><strong>Core Concepts</strong></td><td>Vaults, minting &#x26; redeeming, and fees.</td><td><a href="/core-concepts/vaults">Vaults</a></td></tr><tr><td><strong>Contracts</strong></td><td>On-chain reference and deployment addresses.</td><td><a href="/contracts/contracts">Overview</a></td></tr><tr><td><strong>API Reference</strong></td><td>The read-only REST API for integrators.</td><td><a href="/api-reference/api-reference">Overview</a></td></tr><tr><td><strong>Agentic Development</strong></td><td>Build on NFTX with AI — MCP, LLM-ready docs, and best practices.</td><td><a href="/agentic-development/agentic-development">Overview</a></td></tr></tbody></table>


# Introduction

What NFTX v4 is, in one page — a neutral fungibility layer that turns NFT collections into liquid, tradable markets on Uniswap V4.

NFTX v4 is a **neutral fungibility layer for NFTs**: it turns NFT collections into liquid, fungible markets. Depositing an NFT into a collection's vault mints a fungible **floor token** (an ERC‑20, also called a vault token) that's backed 1:1 by the pool and redeemable for any floor NFT in that vault — so NFTs can be traded, pooled, and priced like any token. It's a relaunch on **Uniswap V4**, keeping fungible floor liquidity and adding a self-assessed listing system for non-floor items.

This section gets you oriented. From here, [How It Works](/how-it-works/floor-tokens) walks through the protocol in plain language — floor tokens, Liquid Listings, swaps, and the collection lifecycle. The deeper [Core Concepts](/core-concepts/vaults) cover the mechanics, the on-chain [Contracts](/contracts/contracts) are the reference, and the [API Reference](/api-reference/api-reference) is for integrators.


# Quickstart

A short, hands-on path through the most common NFTX v4 actions.

A short, hands-on path through the most common NFTX v4 actions.

1. **Find a vault** for the collection you care about.
2. **Mint** vault tokens by depositing one or more NFTs.
3. **Redeem** an NFT from the vault by returning vault tokens (plus any fee).

> Replace this placeholder with concrete steps, code, and links once the relevant interfaces are finalized.


# Floor Tokens

How a collection becomes a fungible ERC-20 backed 1:1 by its pool — and why that makes NFTs instantly tradable.

Every collection on NFTX becomes a **floor token** — an ERC-20 that represents the collection's floor value and is backed 1:1 by the NFTs in its pool. Deposit an NFT and you receive one floor token; hand a floor token back and you can redeem any floor NFT from the pool. That's the whole idea of NFTX in one sentence: **turn a collection into a token, so a trade never has to wait on a counterparty.**

Floor tokens are sometimes called *collection tokens* or *vault tokens* — same thing. Each one carries the collection's ticker (for example, `MILADY` for the Milady pool).

## Backed 1:1 by the pool

A floor token isn't a claim on one specific NFT — it's a claim on *any* floor NFT in the pool. Because every token is backed by exactly one deposited NFT, the supply always matches the pool:

> If there are 100 Miladys in the pool, there are 100 MILADY tokens in circulation. Redeem one MILADY and one Milady leaves the pool — the two always move together.

That 1:1 backing is what makes the token liquid. One floor token is always worth one floor NFT, so you can sell it instantly at floor value instead of waiting for a buyer who wants your specific NFT.

## Feeless entry and exit

Getting into and out of the fungible state is **free**. Depositing an NFT to mint a floor token, and burning a floor token to redeem an NFT, cost nothing beyond gas. NFTX concentrates its fees in the layers where value is actually being priced — Liquid Listings and swaps — not on the doorway in and out. See [Fees](/core-concepts/fees) for the full picture.

## Floor multiples: pricing above the floor

Not every NFT is a floor NFT. A rare trait or a grail is worth more than one floor token, and NFTX prices that premium as a **floor multiple** — the item's price expressed as a multiple of the floor:

* **1.00x** — floor (one floor token)
* **1.50x** — one and a half floor tokens
* **4.00x** — four floor tokens

Floor multiples are what let sellers list non-floor items above floor while still getting instant liquidity. That mechanism is [Liquid Listings](/how-it-works/liquid-listings), and it's built directly on top of the floor token.

{% hint style="info" %}
Floor multiples are stored to two decimal places — `100` means 1.00x, `150` means 1.50x. You'll see the same convention throughout the [Listings](/contracts/listings) contract.
{% endhint %}

## Where floor tokens come from

Floor tokens are minted and burned by the vault (the [Locker](/contracts/locker)) whenever NFTs are deposited or redeemed — see [Minting & Redeeming](/core-concepts/minting-and-redeeming) for the flow, [Vaults](/core-concepts/vaults) for the container that holds the NFTs, and the [Collection Token](/contracts/collection-token) contract for the on-chain ERC-20 itself.


# Liquid Listings

Sell a non-floor item at a price you choose and get paid at floor value immediately — the self-assessed listing system at the heart of NFTX v4.

Floor tokens solve liquidity for floor items — but most collections are worth more than their floor. A rare trait, a low mint number, a grail: these are worth more than one floor token, and a plain floor pool can't price them. **Liquid Listings** are how NFTX gives *every* item instant liquidity, not just the floor.

## The idea

List a non-floor item at a price you choose — expressed as a [floor multiple](/how-it-works/floor-tokens#floor-multiples-pricing-above-the-floor) — and NFTX does two things at once:

1. **You get paid now.** The moment you create the listing, you receive a freshly minted floor token, which you can sell at floor value immediately. You don't wait for a buyer.
2. **The item sells later at your price.** Your NFT sits in the pool listed at your chosen multiple. When someone fills it, you collect the difference between your price and the floor token you already took.

So a Liquid Listing splits a sale into *floor value now* and *the premium later* — instant liquidity for the floor portion, while still capturing the upside if the item sells at your price.

### Worked example: Alice's Milady

> Alice has a non-floor Milady she values at **1.30x** the floor. She deposits it into the pool and lists it at **1.30x**. In return she immediately receives **1 MILADY** token (minus the listing fee), which she can sell right away at floor. When a buyer later fills her listing, she collects the remaining **0.30 MILADY** premium.

Alice got floor liquidity the instant she listed, and still earns the premium if her price is right.

## You set the price — the fee keeps you honest

NFTX uses a **self-assessed** listing model: you price your own item. Nothing stops you from listing a floor Milady at 10x — but the **listing fee** (also called tax) scales with how far above floor you price and how long you list for, so overpricing is allowed, just expensive.

The fee is **prepaid** in the collection's floor token when you create the listing, and **refunded pro-rata** if you cancel or shorten it. It grows with the *square* of the floor multiple and *linearly* with duration, with a softening "kink" at 2.00x so high-value grails stay viable. For a 7-day listing:

| Floor multiple | Fee (7-day listing) |
| -------------- | ------------------- |
| 1.50x          | 0.0225 FLOOR        |
| 2.00x (kink)   | 0.04 FLOOR          |
| 3.00x          | 0.0625 FLOOR        |
| 4.00x          | 0.09 FLOOR          |
| 10.00x         | 0.36 FLOOR          |

{% hint style="warning" %}
Price far above fair value and the fee climbs steeply while the item doesn't sell — the prepaid tax simply bleeds down until the listing closes. The system is designed so that mispricing costs *you*, which is exactly what keeps listings honest.
{% endhint %}

The exact formula, including the math behind the kink, lives in the [Tax Calculator](/contracts/tax-calculator); [Fees](/core-concepts/fees) puts it in context with the protocol's other fees.

## When a listing expires: Dutch auctions

A listing is prepaid for a set duration. When that duration runs out, the listing doesn't just vanish — it decays into a **Dutch auction**: the price falls linearly from your multiple toward floor (1.00x) over a trailing window, until someone buys it or it reaches floor and becomes redeemable like any other pooled NFT.

You can also skip the liquid phase entirely and create a **Dutch listing** from the start — useful when you want a declining-price sale rather than a fixed one.

## Under the hood

Liquid Listings are implemented by the [Listings](/contracts/listings) contract, priced by the [Tax Calculator](/contracts/tax-calculator), and settled in the collection's [floor token](/how-it-works/floor-tokens). Anyone can buy a listed item by filling it — see [Swaps & Trade-Ups](/how-it-works/swaps-and-trade-ups) for how buyers combine floor tokens and ETH to do that.


# Swaps & Trade-Ups

Instant ETH ⇄ token swaps, floor-to-floor NFT swaps, trading up into rarer items, and permissionless re-pricing.

Once a collection is a floor token, trading it is just a token swap — and NFTX layers a few NFT-native moves on top: instant floor swaps, trading up into rarer items, and permissionless re-pricing.

## Instant swaps

Every collection has a **Uniswap V4 pool** pairing its floor token with ETH, so you can trade **ETH ⇄ floor token** at any time, at the pool's price, with no counterparty to wait for. A floor token can also trade in [flex pools](/how-it-works/flex-pools) against other tokens; NFT buys and sells through the app still route through the ETH pool.

Buying an NFT with ETH is the same swap with one extra step. Behind the scenes:

```
ETH → floor token → burn for an NFT
```

Most of your ETH buys one floor token in the pool, and that token is immediately burned to redeem a floor NFT from the vault. Selling is the reverse. You never have to hold the floor token yourself unless you want to.

### Floor-to-floor swaps

If you just want a *different* floor NFT — a different Milady, say — you can swap one floor NFT directly for another. Because both sides are worth exactly one floor token, it's an even trade: **no slippage, no ETH required.** Deposit yours, take another.

Swaps are one of the two places (alongside listings) where NFTX charges a fee. The pool's swap fee is collected through the [NFTX V4 Hook](/contracts/nftx-v4-hook); see [Fees](/core-concepts/fees) for how it works and where it goes.

## Trade-Ups: moving up into rarer items

Because listed items are priced in floor multiples, you can **combine floor value to trade up** into something rarer in a single transaction.

> You hold three floor Miladys but want a rare one listed at **3.00x**. Fill that listing with your three floor tokens — or with two floor tokens plus the ETH equivalent of the third — and you move straight from three floor items into one rare item. No selling, waiting, and re-buying.

The same fill pays the seller cleanly. When Evelyn lists a rare Remilio at 3x, she takes 1 floor token up front and the remaining 2 when it's filled — 3 tokens in total, which she can redeem for floor NFTs, sell, or keep. Trade-Ups turn "sell three, buy one" into one efficient move.

## Re-Listing: permissionless re-pricing

NFTX lets anyone **re-price a pooled item they don't own** — the mechanism that keeps listings honest. An arbitrageur can buy out an existing listing and immediately re-list the same item at a new price **without taking inventory risk**: they pay only the premium above floor to the current owner, plus the new listing fee.

> Carol deposits a Milady as a floor item. Bob notices it actually carries an underpriced rare trait, so he re-lists it at **1.25x** — paying just the new fee, since Carol's item was at floor — and captures the spread if it sells. If an item is already listed at 1.10x and Bob thinks it's worth 1.30x, he re-lists at 1.30x by paying the 0.10 premium to the current owner plus the new fee.

The current owner is always paid the premium they were owed as their listing is filled; the re-lister takes on the pricing bet. The result is a market that continuously pushes pooled items toward fair value.

{% hint style="info" %}
Re-Listing is a single-token action on the [Listings](/contracts/listings) contract (`relist`), and you can't re-list your own listing — only someone else's.
{% endhint %}

## Under the hood

Swaps route through the [NFTX V4 Hook](/contracts/nftx-v4-hook) and the collection's Uniswap V4 pool; the [Zap](/contracts/zap) contract bundles ETH wrapping and the swap so you can go straight from ETH to an NFT (or back) in one call. Trade-Ups and Re-Listing are part of the [Listings](/contracts/listings) contract.


# Creator Royalties

How NFTX honours creator royalties: optional for most collections, enforced for ERC721-C collections whose creators opt in through the Royalty Gate.

NFTX is feeless in and feeless out. That stays true for most collections, but a creator who enforces royalties on their collection can now have NFTX enforce them too.

{% hint style="info" %}
Enforced royalties run through the [Royalty Gate](/contracts/royalty-gate), live on every mainnet. A collection is enforced only once its creator opts in.
{% endhint %}

## Two kinds of collection

* **Most collections** keep feeless entry and exit: no royalty on deposits, sales or buys.
* **Royalty-enforced collections** are ERC721-C collections whose creator has approved the Royalty Gate and left the NFTX Locker off their transfer whitelist. Every route into that collection's vault pays the creator's royalty.

## What changes for you on an enforced collection

The royalty is charged once, when an NFT goes **into** the vault, and it's paid by whoever puts it there. Getting an NFT **out** stays free.

| You want to…                         | What happens                                                                      |
| ------------------------------------ | --------------------------------------------------------------------------------- |
| Sell an NFT for ETH                  | The royalty comes out of the floor token your NFT mints; the rest is sold for ETH |
| Deposit an NFT for floor tokens      | You receive one floor token less the royalty                                      |
| Buy an NFT with ETH or floor tokens  | Unchanged: no royalty                                                             |
| Redeem or swap floor tokens          | Unchanged: no royalty                                                             |
| List an NFT above floor              | Not available yet                                                                 |
| Use your NFTs to pay for another NFT | Not available yet: sell them first, then buy                                      |

For example, a collection with a 9% royalty: depositing one NFT mints 1 floor token, 0.09 goes to the creator and you receive 0.91. Selling it for ETH sells those 0.91 floor tokens into the pool.

The app shows this before you confirm: a note that the collection enforces creator royalties, the royalty and its percentage, and your net payout.

## Behind the scenes

ERC721-C collections choose which contracts may move their NFTs. NFTX's Locker normally pulls your NFT into the vault as one of those approved contracts. On an enforced collection it isn't approved, so it can only pull an NFT when the Royalty Gate gives it a one-time permission for that exact token, and the gate only does that after charging the royalty. The permission is cleared before the transaction finishes.

Exits are different: the Locker sends NFTs out as their owner, which every collection allows. That's why buying, redeeming and listing purchases are never affected.

## For creators

Enforcing royalties on NFTX is your call, made on your collection's own transfer validator. You can switch it on or off at any time. [Creator Token Approvals](/contracts/creator-token-approvals#enforced-royalties-with-the-royalty-gate) has the steps.

A few honest caveats before you switch it on:

* **The royalty makes selling into the vault more expensive.** Floor tokens can trade up to the royalty below your marketplace floor, because that's what it costs to turn an NFT into one.
* **Some flows close.** Listings and NFT-for-NFT swaps aren't available for enforced collections yet.
* **NFTs already in the vault never paid.** Anything deposited before you switched enforcement on can leave freely.
* **Only NFTX is covered.** Transfers between wallets and other marketplaces follow your validator's own rules.


# Flex Pools

Pair a collection's floor token with any token you like — USDC, another project's token, ETH — in extra Uniswap V4 pools beside the canonical flETH pool.

Every collection on NFTX launches with one Uniswap V4 pool: its floor token against **flETH**, created by the [Locker](/contracts/locker) through the [NFTX V4 Hook](/contracts/nftx-v4-hook). That pool is still the heart of a collection's market. **Flex pools** add to it. A flex pool pairs the *same* floor token with a different token — USDC, a partner project's token, or plain ETH — in a second Uniswap V4 pool that runs on the [NFTX Flex Hook](/contracts/nftx-flex-hook).

Anyone can open one. Nothing about the collection, its vault, or its existing pool changes when they do.

## Canonical pool and flex pools

Both kinds of pool trade the same floor token, and that token is still redeemable 1:1 for a floor NFT through the Locker. That shared redemption anchors every pool to the collection's floor: if MILADY trades cheaper in a MILADY/USDC pool than in the MILADY/flETH pool, someone can buy it there, redeem a Milady, and sell it where it is dearer, until the two agree.

The pools are otherwise independent. Each has its own liquidity, its own price, its own LP positions and its own fee accounting. The differences that matter:

|                                                     | Canonical pool                                    | Flex pool                                |
| --------------------------------------------------- | ------------------------------------------------- | ---------------------------------------- |
| Pair token                                          | flETH, always                                     | Any token the whitelist allows (v1: any) |
| Created by                                          | The Locker, once per collection                   | Anyone, any number per collection        |
| Hook                                                | `NFTXV4Hook`                                      | `NFTXFlexHook`                           |
| Swap fee                                            | Dynamic, set by the hook                          | Dynamic, set by the hook (same model)    |
| AMM fee to the protocol                             | Yes                                               | Yes                                      |
| Listing-tax donations                               | Yes — every listing fee is donated into this pool | No                                       |
| Used by NFTX's own flows (Zap, Launchpad, Listings) | Yes                                               | Not yet                                  |

That last two rows are the honest caveat. Listing fees are routed **only into the canonical pool** (see [Fees](/core-concepts/fees)), so a flex pool's LPs earn swap and AMM fees but none of that extra yield. Expect a flex pool's returns to trail the canonical pool's, and its liquidity to stay thinner unless the pair itself is the attraction — a stablecoin, or a token a community already holds.

## Who can create a flex pool

Anyone. Pool creation is permissionless at the Uniswap V4 `PoolManager`; the Flex Hook only checks the pool's shape, then lets it through. Whether a pair token is acceptable is decided by a small separate contract, the **pair-token whitelist**, which the hook's owner can swap for a stricter one later without touching the hook.

The first whitelist, `OpenPairTokenWhitelist`, says yes to every pair — native ETH included. So from day one a collection's floor token can be paired with any ERC-20.

{% hint style="info" %}
Native-ETH flex pools exist on-chain, but the NFTX app does not add liquidity to them yet. If you want a floor-token/ETH pool today, create and fund it through Uniswap's own interface; the NFTX app will list it on the collection's Pools tab once it holds enough of the floor token.
{% endhint %}

## The rules the hook enforces

When a pool is initialised on the Flex Hook, the hook checks, in order:

1. **Pool creation is not paused.** The owner has an emergency switch. Pausing only blocks *new* pools; existing pools keep trading.
2. **The fee is dynamic.** Flex pools use Uniswap V4's dynamic-fee flag so the hook sets the swap fee, exactly as canonical pools do. A static-fee pool is refused.
3. **The tick spacing is 10, 60 or 200.** 60 matches the canonical pools; 200 suits volatile pairs; 10 suits tight ones. Anything else is refused.
4. **Exactly one side is a floor token.** One currency must be a collection token registered on the Locker, and the other must not be. Pools pairing two floor tokens are refused in this first version.
5. **Neither side is flETH.** A floor-token/flETH pool would duplicate the canonical pool without its listing-tax donations, so the hook rejects it outright — this is the one rule the whitelist cannot override.
6. **The pool was not previously retired** (see below).
7. **The whitelist approves the pair.** The hook asks `isPairTokenAllowed(collectionToken, pairToken)`; a `false` refuses the pool.

If every check passes, the hook records the pool, seeds its price oracle, and emits `FlexPoolInitialized`. Liquidity is then added through Uniswap's `PositionManager` like any other V4 pool.

## Adding liquidity

### On nftx.io

Each collection page has a **Pools** tab listing every Uniswap V4 pool that holds the collection's floor token — canonical, flex, and pools with no NFTX hook at all. Pools holding at least **$100** of the floor token lead the table; smaller ones are shown dimmed below. Each row shows the pair, the hook, the fee, both sides' depth, TVL, price, volume, fee APR and the pool's share of the eligible depth. **Add liquidity** on any NFTX-hooked row opens the add-liquidity page pointed at that pool; pools without an NFTX hook link out to Uniswap.

On the add-liquidity page, the **Pool** section at the top asks which pool the position goes into:

* **Existing pools** — pick one of the collection's NFTX-hooked pools.
* **New pairing** — paste the address of the token you want to pair with. The app checks on-chain that it is a real ERC-20 (and not the floor token, not flETH, and not a token that already has a pool), then asks for a tick spacing and an opening price. Creating the pool and minting your first position happen in the same transaction.

{% hint style="warning" %}
The Pools tab and the Pool section are rolling out on nftx.io behind a feature flag. Until they are switched on for everyone, use Uniswap's interface below — the pools are the same either way.
{% endhint %}

### On Uniswap

Any flex pool is an ordinary Uniswap V4 pool. In Uniswap's position creator, choose the floor token and your pair token, select **dynamic fee**, pick a tick spacing of 10, 60 or 200, and set the hook to the Flex Hook address for the chain (`0xC26A5Cb51b1818F62a4C6693a9a1feDB3340efc4` on Ethereum Mainnet). If the pool does not exist yet, Uniswap initialises it and mints your position together.

One thing to know if you script this: `PositionManager.initializePool` swallows a hook revert and returns without creating the pool. Read `poolParams(poolId).initialized` on the hook afterwards, or call `PoolManager.initialize` directly so a refusal reverts loudly.

## Fees on a flex pool

Flex pools use the same fee model as canonical pools, run by the same shared hook logic:

* **LP fee.** Dynamic, resolved by the hook per pool, with the same per-origin fee exemptions the canonical hook offers. The Flex Hook starts with the canonical hook's default (0.9% on Ethereum Mainnet at deployment) and the owner can set a pool-specific override.
* **AMM fee.** A protocol fee taken from every swap's unspecified leg (0.1% at deployment) and credited to the protocol's fee receiver through the hook's escrow. On a flex pool this fee is whatever token that leg is in — USDC in a USDC pool, ETH in a native pool — and the hook credits what actually arrived, so a pair token that charges a transfer fee cannot leave the escrow short.

What flex pools do **not** receive is listing tax: those donations only ever reach the canonical pool.

## Existing collections

A collection does not need to do anything to gain a flex pool, and it cannot prevent one. Take Milady: its floor token is registered on the Locker, its canonical MILADY/flETH pool has been live since launch, and neither fact changes. Anyone can now initialise a MILADY/USDC pool on the Flex Hook and fund it. The Locker, Listings and the canonical hook are not involved and need no update.

## What is not possible yet

* **One purchase drawing on two pools.** The [Zap](/contracts/zap) — the contract behind "buy this NFT with ETH" — resolves exactly one pool per collection, the canonical one, and settles in flETH only. A buy that sources floor tokens from both the canonical pool and a flex pool in a single transaction needs a flex-aware zap, which is planned but not deployed. Until then, flex pools are for trading and providing liquidity in the floor token itself; NFT buys and sells still route through the canonical pool.
* **Two floor tokens in one pool.** Refused by the hook in v1.
* **Adding liquidity to a native-ETH pool from the NFTX app.** Use Uniswap.

## Retired pools

The Locker never "un-registers" a floor token, so when a collection is [wound down](/how-it-works/collection-lifecycle), a flex pool would otherwise keep quoting a token that can no longer be redeemed. The hook's owner can **deregister** such a pool: swaps on it revert from then on, liquidity can still be withdrawn, and the pool can never be re-opened. This is part of the shutdown runbook, not a routine control.

## Risks to weigh before you provide liquidity

* **Thinner liquidity and lower yield than the canonical pool.** No listing-tax donations reach a flex pool.
* **Prices can diverge between venues** until arbitrage closes the gap. Redemption bounds the gap, but it does not remove it.
* **The whitelist is open in v1.** Any token can be paired, including tokens with odd transfer behaviour. The hook protects its own fee escrow against that; it cannot protect the pool's LPs from a pair token that misbehaves.
* **The opening price of a new pool is set by whoever creates it.** Check it before adding to a pool someone else opened.
* **Native pools split ETH liquidity** with the canonical flETH pool. If that proves harmful, a stricter whitelist can deny `address(0)` for new pools; it would not close existing ones.

For the contract-level detail — every error, event and admin function — see the [NFTX Flex Hook](/contracts/nftx-flex-hook) reference.


# Collection Lifecycle

How a collection is launched onto NFTX and how a community-driven shutdown gives final holders a fair exit.

A collection on NFTX has a beginning and, if liquidity dries up, a graceful end. Both are permissionless and designed so no one is left holding an NFT they can't exit.

## Launching a collection

Any collection can be brought onto NFTX by creating its vault and floor token. Who's allowed to do that is controlled by a **launch gate** — a swappable contract that a collection can set to be either:

* **Permissionless / public** — anyone can create the collection, or
* **Curated** — creation is limited to an approved party.

To lower the capital needed to bootstrap trading, a new pool can be initialized **single-sided** — seeded with collection tokens alone, without a matching amount of paired ETH. That means a collection can go live and start trading without someone having to supply deep ETH liquidity on day one.

The gates and related machinery live in the [Supporting Contracts](/contracts/supporting).

## Shutting a collection down

Sometimes a collection winds down — holders redeem out until only a handful of NFTs and some dust-sized token balances remain. Left alone, those last holders could be stuck, with too little liquidity to trade out. NFTX has a **community-driven shutdown** path for exactly this.

How it works:

1. **Reach quorum by locking tokens.** Once the circulating token supply has fallen low enough, holders vote for shutdown by locking their tokens. The vote passes when it reaches quorum.
2. **Liquidate the remaining NFTs.** The NFTs still in the pool are sold off externally (via a Sudoswap auction), converting them to ETH.
3. **Distribute pro rata.** The proceeds are shared out **pro rata** to the token holders who took part — so the final holders get their fair share of value instead of being stranded.

{% hint style="warning" %}
Shutdown is **permanent**. Once a collection is wound down, it's sunset for good — this is deliberate, so a settled collection can't be resurrected in a half-liquidated state. It's an exit of last resort, not a pause.
{% endhint %}

The full mechanism — quorum thresholds, the liquidation auction, and how proceeds are claimed — is documented in [Collection Shutdown](/contracts/collection-shutdown).


# Migrating from NFTX v2/v3

How to move NFTX v1–v3 vault tokens into v4 — whole NFTs migrate in one transaction, and sub-unit "dust" balances get a 1:1 swap path.

NFTX pioneered fungible NFT liquidity in 2020, and plenty of vault tokens from those earlier generations are still out there. If you hold v2 or v3 vault tokens (vTokens), the **Migrator Zap** moves you into v4 in a single transaction: it redeems whole NFTs from the legacy vault, deposits them straight into the v4 vault, and mints you the collection's [floor token](/how-it-works/floor-tokens) 1:1.

Behind the scenes, one migration call does three things: it pulls your legacy vault tokens, burns them against the legacy vault to withdraw the specific NFTs you named, and deposits those NFTs into the v4 Locker — which mints fresh floor tokens directly to whichever address you choose. The NFTs only pass through the zap for the length of the transaction; nothing is held.

{% hint style="info" %}
Migration runs on **Ethereum Mainnet only** — the legacy v2/v3 vaults were never deployed anywhere else.
{% endhint %}

## Whole units migrate instantly

One NFT costs exactly `1.0` legacy vault tokens, so migration works in whole units: `N` vault tokens → `N` NFTs → `N` floor tokens. The two legacy generations charge for the redeem differently:

* **From v2**, the vault's redeem fee is paid in vault tokens on top of the principal — unless the zap has been fee-excluded by the legacy factory owners, in which case you pay the principal alone. `quoteV2` tells you the exact cost before you commit.
* **From v3**, the redeem fee and any premium are paid in ETH. Premiums apply to recently deposited items and can be significant — `quoteV3Eth` prices your exact token IDs, and any ETH the vault doesn't take is refunded in the same transaction.

For example: Alice holds `3.4 MILADY` from NFTX v2. She calls `migrateFromV2` with three token IDs, spends `3.0` vault tokens (plus the v2 redeem fee if the zap isn't fee-excluded yet), and receives `3.0` v4 MILADY floor tokens. The `0.4` left over can never redeem an NFT on its own — that remainder is what we call **dust**.

## The dust swap

Dust is a legacy balance below `1.0` — too small to redeem an NFT, and often too small to be worth selling. Rather than leave it stranded, the Migrator Zap carries a simple escrow:

{% stepper %}
{% step %}

## We register the pair

For each legacy vault token being retired, we register which v4 token replaces it. Deposits are only accepted for registered pairs.
{% endstep %}

{% step %}

## You deposit your dust

Call `depositDust` with the legacy token and amount. The zap escrows it and records the deposit under an ID that's yours alone.
{% endstep %}

{% step %}

## We fill the swap — always at 1:1

We settle deposits in batches. When yours is filled you receive exactly the amount you deposited, in the replacement token, and the swap is closed. Deposit `0.4`, receive `0.4`.
{% endstep %}
{% endstepper %}

Changed your mind, or tired of waiting? Call `withdrawDust` and your legacy tokens come straight back. Cancelling works at any time before the fill — even while the zap is paused, and even if the pair has since been retired.

## Being straight about the trust assumptions

The dust swap is an escrow with a manual fill, and you should understand exactly what that means before depositing:

* **Fill timing is at our discretion.** Deposits are settled in batches, and nothing on-chain guarantees *when* a batch is filled. The payout also comes from replacement tokens we fund onto the contract ahead of settlement.
* **Your exit is never at our discretion.** Withdrawal is the one path that can't be paused, and escrowed deposits are excluded from every owner-recovery function — the contract cannot sweep your dust out from under you. Until the moment your swap is filled, your tokens are one transaction away.

That's the whole deal: we control when the swap completes; you control whether your tokens stay in it.

The full function reference lives in the [Migrator Zap](/contracts/migrator-zap) contract page.


# Vaults

The container at the heart of every NFTX collection — one collection's NFTs, one fungible token, backed 1:1.

A **vault** is the container at the heart of every NFTX collection. It holds the deposited NFTs from a single collection and issues a fungible [floor token](/how-it-works/floor-tokens) against them — one token for each NFT it holds. Everything else in NFTX (listings, swaps, trade-ups) is built on top of this one primitive.

On-chain, the vault is the [Locker](/contracts/locker) contract.

## One collection, one vault

Each vault is tied to a **single ERC-721 collection**, and each supported collection has one vault. Deposit a Milady and you're depositing into the Milady vault, which mints MILADY tokens; you can't deposit a different collection's NFT into it. This is what keeps a floor token cleanly backed: every MILADY in circulation corresponds to exactly one Milady sitting in the vault.

## Eligibility

A vault accepts the NFTs of its collection. Which token IDs qualify as floor items — and any rules a collection sets around what it will hold — are part of the vault's configuration. Rare or non-floor items aren't excluded; they're handled through [Liquid Listings](/how-it-works/liquid-listings), which price them above floor rather than treating them as a plain floor deposit.

## Lifecycle

A vault moves through a simple lifecycle:

1. **Creation.** A collection is launched onto NFTX, creating its vault and floor token. Who can do this is set by the collection's launch gate — see [Collection Lifecycle](/how-it-works/collection-lifecycle).
2. **Active.** NFTs are deposited and redeemed, listings are created and filled, and the floor token trades against ETH in the collection's Uniswap V4 pool.
3. **Shutdown (if needed).** If a collection becomes illiquid, holders can vote to wind it down and distribute the remaining value — also covered in [Collection Lifecycle](/how-it-works/collection-lifecycle).

## Non-custodial and non-upgradeable

The vault never takes custody in the traditional sense — your NFT is held by an immutable contract, not a company, and you can redeem an equivalent NFT at any time by returning a floor token. The contracts are **non-upgradeable**: the deployed logic can't be swapped out from under you. As with any protocol, that doesn't remove risk — even audited code can contain bugs — but it does mean the rules you deposit under are the rules that stay in force.

For the full contract surface — `deposit`, `redeem`, `swap`, and collection creation — see the [Locker](/contracts/locker) reference.


# Minting & Redeeming

The two feeless doors in and out of a collection's fungible state — deposit an NFT to mint a token, burn a token to redeem an NFT.

Minting and redeeming are the two feeless doors in and out of a collection's fungible state. Together they're what make a floor token redeemable — and what make "buy an NFT" as simple as a swap.

## Minting: NFT → floor token

**Minting** deposits an NFT into the [vault](/core-concepts/vaults) and issues a floor token in return:

```
NFT → vault → 1 floor token
```

Deposit one Milady and you receive 1 MILADY, freshly minted and backed by the NFT you just deposited. You can hold it, sell it at floor value in the collection's pool, or use it to buy a different item. Minting is **feeless** — you pay only gas.

## Redeeming: floor token → NFT

**Redeeming** is the reverse: burn a floor token and withdraw an NFT from the vault.

```
1 floor token → vault → NFT
```

A plain redeem returns a **floor NFT** from the pool — any item held at floor, since each is worth exactly one token. Redeeming is **feeless** too. If instead you want one *particular* item that's worth more than floor, that item is a [Liquid Listing](/how-it-works/liquid-listings) priced above floor: you buy it by filling its listing at its [floor multiple](/how-it-works/floor-tokens#floor-multiples-pricing-above-the-floor), rather than by a plain redeem.

## Behind the scenes: buying an NFT with ETH

Most people never touch the floor token directly — they just want to buy or sell an NFT with ETH. That works because a buy is a swap plus a redeem bundled into one transaction:

```
ETH → floor token → burn for an NFT
```

Behind the scenes, most of your ETH buys one floor token in the collection's Uniswap V4 pool, and that token is immediately burned to redeem a floor NFT. Selling runs the same steps in reverse. See [Swaps & Trade-Ups](/how-it-works/swaps-and-trade-ups) for more.

## Feeless in, feeless out

Both mint and redeem are free by design. NFTX doesn't tax the entrance or the exit — it charges only where value is actually being priced: in the [listing system](/how-it-works/liquid-listings) and on [swaps](/how-it-works/swaps-and-trade-ups). [Fees](/core-concepts/fees) lays out the whole model.

{% hint style="info" %}
The one exception is a collection whose creator enforces royalties on NFTX. Minting into its vault pays the creator's royalty, taken out of the floor token your NFT mints; redeeming stays free. See [Creator Royalties](/how-it-works/creator-royalties).
{% endhint %}

The on-chain functions behind all of this — `deposit`, `redeem`, and `swap` — live on the [Locker](/contracts/locker).


# Fees

Feeless entry and exit, listing tax and swap fees where value is priced, and real yield routed back to liquidity providers.

NFTX keeps its fee model simple and honest: **getting in and out is free, and fees live only where value is actually priced** — listing an item above floor, and swapping. There's no deposit fee and no redemption fee.

## Feeless entry and exit

[Minting](/core-concepts/minting-and-redeeming) an NFT into a floor token and [redeeming](/core-concepts/minting-and-redeeming) a floor token back into an NFT are both **feeless** — you pay only gas. This is deliberate: NFTX wants the fungible state to be frictionless to enter and leave, so liquidity isn't taxed at the door.

## Listing fees (tax)

When you create a [Liquid Listing](/how-it-works/liquid-listings) above floor, you prepay a **listing fee** — often called tax — in the collection's floor token. It's the price of asking more than floor, and it does two jobs: it funds the sale and it discourages overpricing.

The fee scales with the **square of the floor multiple** and **linearly with duration**, normalised to a 7-day reference, with a softening **kink at 2.00x** so high-value grails stay viable. A 7-day listing works out to:

| Floor multiple | Fee (7-day listing) |
| -------------- | ------------------- |
| 1.50x          | 0.0225 FLOOR        |
| 2.00x (kink)   | 0.04 FLOOR          |
| 3.00x          | 0.0625 FLOOR        |
| 4.00x          | 0.09 FLOOR          |
| 10.00x         | 0.36 FLOOR          |

The tax is **prepaid** when the listing is created and **refunded pro-rata** if you cancel or shorten it, so you only ever pay for the price and time you actually use. The full formula and the reasoning behind the kink are in the [Tax Calculator](/contracts/tax-calculator).

## Swap fees

The other place NFTX charges is **swaps**. Every collection's floor token trades against ETH in a Uniswap V4 pool, and a swap fee is taken on those trades. The fee is collected through the [NFTX V4 Hook](/contracts/nftx-v4-hook), which is the single integration point for pool fees — including per-collection fee levels and fee exemptions.

A floor token can also trade in [flex pools](/how-it-works/flex-pools) — extra Uniswap V4 pools pairing it with USDC, ETH or another token, run by the [NFTX Flex Hook](/contracts/nftx-flex-hook). They charge the same dynamic swap fee and the same protocol AMM fee, in whatever token the pool holds.

## Where the fees go: real yield for liquidity providers

Listing and swap fees don't disappear into a treasury black box — they're routed back to the people providing liquidity. NFTX uses Uniswap V4's `donate()` method to send this revenue **directly into the collection's pool**, where liquidity providers (LPs) claim it the same way they claim ordinary swap fees. NFTX calls these **exogenous fees**: revenue that originates outside the pool's own trading but is paid out through it.

The payoff is **real yield** for LPs beyond raw swap volume, which helps offset **impermanent loss** — the opportunity cost an LP takes on when the prices of the two pooled assets move apart. More fee income flowing to LPs makes providing liquidity to NFTX pools more sustainable.

Those donations go to the collection's **canonical flETH pool only**. A flex pool's liquidity providers earn its swap fees but none of the listing tax, so expect their yield to trail the canonical pool's.

{% hint style="info" %}
In short: **feeless in and out, fees on listings and swaps, and those fees flow back to liquidity providers** through the pool itself.
{% endhint %}


# Overview

The NFTX v4 on-chain contracts — what each one does, how they fit together, and where they're deployed.

NFTX v4 is a set of **non-upgradeable** Solidity contracts that turn an NFT collection into a fungible, liquid market on top of **Uniswap V4**. This section is the on-chain reference: an architecture overview, the [deployment addresses](/contracts/addresses) per chain, and a page per contract documenting its public functions, inputs, and return values.

{% hint style="info" %}
Built with Foundry on Solidity `^0.8.26`. Key dependencies: Uniswap V4 core/periphery and hooks, Permit2, OpenZeppelin (including upgradeable ERC20 primitives for the clone-based collection token), and Solady.
{% endhint %}

For collections with enforced creator-token transfers, see [Creator Token Approvals](/contracts/creator-token-approvals) for the operator addresses to send to the collection team.

## How the pieces fit together

At the center is the **Locker**, which custodies every deposited ERC-721 and mints a fungible ERC-20 **collection token** (the collection's floor token) in return. Redeeming burns the token and returns an NFT. Everything else builds on that core:

* [**Locker**](/contracts/locker) — the vault. Holds the NFTs, mints/burns collection tokens, and exposes the core `deposit` / `redeem` / `swap` operations plus collection creation. Entry and exit are feeless; fees live in the listing and AMM layers.
* [**Collection Token**](/contracts/collection-token) — the ERC-20 that represents a collection. Deployed as a minimal-proxy clone per collection; mint and burn are restricted to the Locker.
* [**Listings**](/contracts/listings) — the self-assessed listing system. Sellers list non-floor items at a chosen floor multiple (liquid or Dutch), paying a tax that scales with price and duration.
* [**Tax Calculator**](/contracts/tax-calculator) — prices that listing tax from the floor multiple and duration, with a softening kink above `2.00x`.
* [**NFTX V4 Hook**](/contracts/nftx-v4-hook) — the Uniswap V4 hook. The single integration point for pool fees and swaps, including per-collection fees and fee exemptions.
* [**NFTX Flex Hook**](/contracts/nftx-flex-hook) — the second hook. Permissionless pools pairing a collection token with any whitelisted pair token, sharing the canonical hook's fee logic.
* [**Zap**](/contracts/zap) — convenience entry point for atomic ETH ↔ NFT flows.
* [**Migrator Zap**](/contracts/migrator-zap) — one-transaction migration from the legacy NFTX v2/v3 vaults into v4, with a 1:1 dust escrow for sub-unit legacy balances (Ethereum Mainnet only).
* [**Collection Shutdown**](/contracts/collection-shutdown) — a community-driven wind-down path for collections that have become illiquid.
* [**Supporting Contracts**](/contracts/supporting) — the Locker Manager, collection launch gates, the liquidation bonding curve, and token escrow.
* [**Royalty Gate**](/contracts/royalty-gate) — the royalty-charging entrance to the Locker for ERC721-C collections that enforce creator royalties on NFTX. Live on every mainnet.

## A typical flow

```
Deposit:  NFT  → Locker → mint collection token   (feeless)
Redeem:   collection token → Locker → NFT         (feeless)
List:     NFT  → Listings → collection token now, sale later (tax applies)
Trade:    ETH  ⇄ collection token via the Uniswap V4 pool (Hook charges fees)
```

## Contract reference

<table data-view="cards"><thead><tr><th>Contract</th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Deployment Addresses</strong></td><td>Deployed addresses per chain</td><td><a href="/contracts/addresses">Deployment Addresses</a></td></tr><tr><td><strong>Locker</strong></td><td>The vault: deposit, redeem, swap, create</td><td><a href="/contracts/locker">Locker</a></td></tr><tr><td><strong>Collection Token</strong></td><td>The per-collection ERC-20</td><td><a href="/contracts/collection-token">Collection Token</a></td></tr><tr><td><strong>Listings</strong></td><td>Self-assessed liquid &#x26; Dutch listings</td><td><a href="/contracts/listings">Listings</a></td></tr><tr><td><strong>Tax Calculator</strong></td><td>The listing fee curve</td><td><a href="/contracts/tax-calculator">Tax Calculator</a></td></tr><tr><td><strong>NFTX V4 Hook</strong></td><td>Uniswap V4 fee &#x26; swap integration</td><td><a href="/contracts/nftx-v4-hook">NFTX V4 Hook</a></td></tr><tr><td><strong>NFTX Flex Hook</strong></td><td>Permissionless pair-token pools</td><td><a href="/contracts/nftx-flex-hook">NFTX Flex Hook</a></td></tr><tr><td><strong>Zap</strong></td><td>Atomic ETH ↔ NFT flows</td><td><a href="/contracts/zap">Zap</a></td></tr><tr><td><strong>Collection Shutdown</strong></td><td>Wind-down for illiquid collections</td><td><a href="/contracts/collection-shutdown">Collection Shutdown</a></td></tr><tr><td><strong>Supporting Contracts</strong></td><td>Manager, gates, curve, escrow</td><td><a href="/contracts/supporting">Supporting Contracts</a></td></tr><tr><td><strong>Royalty Gate</strong></td><td>Enforced creator royalties for ERC721-C</td><td><a href="/contracts/royalty-gate">Royalty Gate</a></td></tr></tbody></table>


# Deployment Addresses

Deployed NFTX v4 contract addresses on Ethereum Mainnet, Base Mainnet, Arbitrum One, Ink, Arc, ApeChain, Robinhood Chain, Ethereum Sepolia, Robinhood Chain Testnet, and the earlier Base deployments.

For enforced creator-token collections, use the [Creator Token Approvals](/contracts/creator-token-approvals) guide to identify which addresses the collection team must allow as NFT operators.

NFTX v4 is live on nine chains: **Ethereum Mainnet** (chain ID `1`), **Base Mainnet** (`8453`), **Arbitrum One** (`42161`), **Ink** (`57073`), **Arc** (`5042`), **ApeChain** (`33139`), **Robinhood Chain** (`4663`), **Ethereum Sepolia** (`11155111`) and **Robinhood Chain Testnet** (`46630`). Addresses below are taken directly from the deployment records in the Contracts repository (`deployments/deployment-<chainId>.md`), which are the source of truth.

Those nine chains share one address book. Every contract is deployed through CreateX's CREATE3 from the same deployer under the same salt namespace, and a CREATE3 address derives from those three inputs alone — not from the creation code, the constructor arguments, or the chain ID. So the `Locker` you integrate against on Robinhood Chain carries the same address as the one on Mainnet.

Base Mainnet joined that address book on 18 September 2026, when it was redeployed onto the current generation. The deployment it replaced, and Base Sepolia, are listed at the end. They are an earlier generation of the protocol, deployed under a different salt namespace, so they share none of those addresses and are not served by the API.

Three addresses per chain fall outside that guarantee, and all three are external to the deployment: the Uniswap V4 `PoolManager` and `PositionManager`, which each chain deploys for itself, and `flETH` on the mainnets, which is deployed separately from the protocol. The testnets have no canonical flETH, so the deploy script ships a `FlETHMock` — and because that one *is* CREATE3-derived, it carries the same address on both. Arc has no flETH at all: its pools quote in USDC, which is a system contract there. ApeChain has no Uniswap V4 at all: it trades on Armory, a Uniswap V3 fork, so its section lists Armory's contracts in place of the V4 pair.

Protocol contracts can be exceptions too: `NFTXZap` on Base Mainnet, Arc and ApeChain sits at a different address from the other chains, and ApeChain runs `NFTXArmory` where every other chain runs `NFTXV4Hook`, for the reasons given in those chains' sections.

The [`RoyaltyGate`](/contracts/royalty-gate) is on every mainnet at `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F`, deployed on 8 October 2026 under its own salt in the `nftx.v3` namespace, and isn't deployed on the testnets. Its constructor takes each chain's `NFTXZap`, which CREATE3 keeps out of the address.

{% hint style="warning" %}
Always confirm against the on-chain record before integrating.
{% endhint %}

## Ethereum Mainnet (chain `1`)

### Protocol contracts

| Contract                              | Address                                      |
| ------------------------------------- | -------------------------------------------- |
| `Locker`                              | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`)            | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| `Listings`                            | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                          | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `NFTXFlexHook`                        | `0xC26A5Cb51b1818F62a4C6693a9a1feDB3340efc4` |
| `OpenPairTokenWhitelist`              | `0x0A97DDb5d5B96ed0E9E014ced7bC7AD20b8Df494` |
| `Notifier`                            | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                       | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                       | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)    | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (native token)                | `0x000000000bB1f9944965c64066D10038a84F9af2` |
| `ProtocolFeeReceiver`                 | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `CollectionShutdown`                  | `0x28bA2f2A1E38B4547b39675D8E1d96A016e626fF` |
| `LinearRangeCurve`                    | `0x0aBBeFaB8904cd3Cd478d376AD282f796056d95d` |
| `NFTXZap`                             | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `MigratorZap` (Ethereum Mainnet only) | `0x08222EA6aBe9111b77cf006Dc7F0a7c71fcCF390` |
| `RoyaltyGate`                         | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

`NFTXFlexHook` and `OpenPairTokenWhitelist` are the [flex pools](/how-it-works/flex-pools) deployment (2026-09-08, block `25933487`). They are live on Ethereum Mainnet first; the other chains above are not yet deployed, and when they are, CREATE3 gives them these same two addresses. See the [NFTX Flex Hook](/contracts/nftx-flex-hook) reference.

### External references (Uniswap V4)

NFTX v4 builds on Uniswap V4. The pool infrastructure it integrates with:

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x000000000004444c5dc75cB358380D2e3dE08A90` |
| Uniswap V4 `PositionManager` | `0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e` |

## Base Mainnet (chain `8453`)

Base is an OP-stack chain with ETH as its native currency. It was redeployed onto the current generation on 18 September 2026 (first transaction in block `51,475,463`) and runs the same address book as Ethereum Mainnet. Four things set it apart from the other chains on that book:

* **`CollectionShutdown` is present.** Sudoswap's `PairFactory` exists on Base, so `CollectionShutdown` and `LinearRangeCurve` are both deployed, as they are on Ethereum Mainnet and unlike on Arbitrum One, Ink and Robinhood Chain.
* **`NFTXZap` has a different address.** On Base it is `0xDf288b66a77f25197544877eaF4626d7E64cb5A8`, not the `0x0000001441…9A3C` you will find on the other chains. A CREATE3 address does not depend on the code deployed to it, and on Base this one carries the current zap — creator royalties and native payments included. Do not assume the zap address carries across chains; read it from the table for the chain you are on.
* **The price oracle is seeded for two-second blocks.** Each new pool starts with 300 observation slots, a guaranteed price window of roughly ten minutes. Launches grow that to 901 slots, which is thirty minutes.
* **The contracts are still owned by the deployer** (`0xB8A70b4d1547bf6193bd67A73F4F98ea9FD0A973`), not the Labs multisig. The `WhiteGlove` gate admits only its own owner, so curated launches run before ownership moves.

`flETH` here is the canonical Flayer deployment for the chain, and predates this redeploy.

### Protocol contracts

| Contract                             | Address                                      |
| ------------------------------------ | -------------------------------------------- |
| `Locker`                             | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, attached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, unattached)   | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| `Listings`                           | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                         | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                           | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                      | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                      | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)   | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (native token)               | `0x000000000D564D5be76f7f0d28fE52605afC7Cf8` |
| `ProtocolFeeReceiver`                | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `CollectionShutdown`                 | `0x28bA2f2A1E38B4547b39675D8E1d96A016e626fF` |
| `LinearRangeCurve`                   | `0x0aBBeFaB8904cd3Cd478d376AD282f796056d95d` |
| `NFTXZap`                            | `0xDf288b66a77f25197544877eaF4626d7E64cb5A8` |
| `RoyaltyGate`                        | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

The `Locker` is attached to the `WhiteGlove` gate; the `Public` gate is deployed but detached. All thirteen contracts are verified on [Basescan](https://basescan.org/address/0xb4C5b5235b98114E9DC227b54e088C11680b2385).

### Route 24 card wrappers

Base is the first chain to carry the Route 24 card wrappers. Route 24 bridges physically backed trading cards from Courtyard into a single ERC-721 per chain, and an NFTX collection is keyed by contract address, so one *set* of cards has no address of its own to build a collection on. A `Route24CardWrapper` supplies one: it admits a bridged card only when the card's on-chain Route 24 attestation matches the set, and releases it again to whoever holds the wrapped token, with no condition attached to the way out.

| Contract                                                              | Address                                      |
| --------------------------------------------------------------------- | -------------------------------------------- |
| `Route24WrapperFactory`                                               | `0x61046e1d979FFf182f54d9f1C9682391b629B0dD` |
| `Route24CardWrapper` (implementation)                                 | `0x51257f03DE422A3dC39eE3fE78cf44Ed42981d20` |
| `Route24TraitSource`                                                  | `0x6299e2C1d638c395c962FaB40655dC55CEF6F827` |
| `Route24CardWrapper`: Prismatic Evolutions Booster Pack (`PRISMATIC`) | `0x2c1523aA50475EECc35d57538E25fadc2e4E562a` |
| `CollectionToken`: `PRISMATIC`                                        | `0x8b3Bc6942D6823a8022605648b671A2FeB954800` |
| `Route24CardWrapper`: 151 Booster Packs (`SV151`)                     | `0x475860c8ea74dec7eeF49cea32565e71ad90d0aB` |
| `CollectionToken`: `SV151`                                            | `0x107c7f4c06ED0E88c0B958eD51701094AD012681` |

The factory, the implementation and the trait source are CREATE3 deployments, so they will carry these addresses on any other chain they reach. A wrapper's address is different in kind: it is derived from the bridged collection and the set's criteria, so it is specific to the set it serves. Authenticate a wrapper through the factory — `isWrapper(wrapper)` must hold — and never by its bytecode, which every wrapper shares.

The wrappers read from Route 24's own contracts, which are external to this deployment:

| Contract                                             | Address                                      |
| ---------------------------------------------------- | -------------------------------------------- |
| Route 24 bridged Courtyard collection (`wCOURTYARD`) | `0x5B43182d0A85ee832F6B50549c65d357878D18F0` |
| Route 24 `CardAttestationResolver`                   | `0xe8ed98946A4bc9D93cE7992e570a941Cb8E73f17` |

The `PRISMATIC` wrapper is the first Route 24 set with an NFTX collection over it, launched on 18 September 2026. It admits a bridged card when Route 24 attests it as sealed product (`productType` `3`), ungraded (`grade` `0`), from set `sv8pt5`, in English (`language` `en`). The collection opened with one pack priced at 17.20 USD — `0.006659` ETH at the time — paired against ETH across the full range, in pool `0xce6fa2a33e826d01a615086e6943d8f1da1caf56f76468af8968193418ceee4c`.

On 23 September 2026 fourteen more packs joined that position, so the vault holds fifteen, and a second set followed: **151 Booster Packs**, over the `SV151` wrapper. It admits a bridged card attested as sealed product (`productType` `3`), ungraded (`grade` `0`), from set `sv3pt5` (Scarlet & Violet 151), in English. It opened with fifteen packs priced at 29.89 USD each — `0.010883` ETH at the time, Courtyard's floor for the pack — paired against ETH across the full range, in pool `0xe8df48aa83c51f5c…`.

{% hint style="info" %}
Neither set's criteria name the product, so any sealed English product of the set that Route 24 attests can be wrapped in, not only single booster packs. A single pack is the cheapest of those, so that is the floor the collection tracks — wrapping anything worth more means selling it at the pack's price.
{% endhint %}

An earlier wrapper for the same set, `PRISM` (`0x80Ba5cD66E75428CC581f1c0b4139b5fB95fE0A7`), also required a matching card name. It is deployed and will still wrap a card, but no collection was created over it and none will be: build against `PRISMATIC`.

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x498581fF718922c3f8e6A244956aF099B2652b2b` |
| Uniswap V4 `PositionManager` | `0x7C5f5A4bBd8fD63184577525326123B519429bDc` |

{% hint style="warning" %}
Base is deployed but not yet served. The [NFTX v4 API](/api-reference/api-reference) and the subgraph do not index chain `8453` yet, so reads for Base have to go to the chain directly until they do.
{% endhint %}

## Arbitrum One (chain `42161`)

Arbitrum One runs the same address book as Ethereum Mainnet, and — like Robinhood Chain, which is also an Arbitrum Nitro chain — differs from it in two ways:

* **`CollectionShutdown` is absent.** Shutdown liquidates a vault's NFTs through a Sudoswap `PairFactory`, and Arbitrum One has none — so neither `CollectionShutdown` nor `LinearRangeCurve` is deployed, and collections there cannot be wound down. Every other protocol surface behaves identically.
* **The price oracle is seeded deeper.** Blocks land several times a second, but the oracle stores at most one observation per second, so each new pool is seeded with 512 observation slots rather than Ethereum Mainnet's 32 — a guaranteed price window of roughly 8.5 minutes. Longer windows are bought per pool with `increaseObservationCardinalityNext`, which anyone may call.

`flETH` here is the canonical Flayer deployment for the chain, with its Aave V3 strategy attached: deposited ETH earns yield exactly as it does on Ethereum Mainnet.

### Protocol contracts

| Contract                             | Address                                      |
| ------------------------------------ | -------------------------------------------- |
| `Locker`                             | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, attached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, unattached)   | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| `Listings`                           | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                         | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                           | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                      | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                      | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)   | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (native token)               | `0x0000000006E53afede11caeB440B6FFf4398337D` |
| `ProtocolFeeReceiver`                | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                            | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `RoyaltyGate`                        | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

Both launch-gate rows are listed because both contracts exist on-chain. The `Locker` is attached to the `WhiteGlove` gate, which only its owner may launch through; the `Public` gate is deployed but detached, and launching does not consult it.

### External references (Uniswap V4)

Uniswap deploys V4 deterministically on Arbitrum One and Ink, so the `PoolManager` carries the same address on both; only the `PositionManager` differs.

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32` |
| Uniswap V4 `PositionManager` | `0xd88F38F930b7952f2DB2432Cb002E7abbF3dD869` |

{% hint style="info" %}
Arbitrum One is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/arbitrum/...` or `/v1/42161/...`.
{% endhint %}

## Ink (chain `57073`)

Ink is an OP-stack chain with ETH as its native currency. It runs the same address book as Ethereum Mainnet and differs from it in the same two ways as Arbitrum One and Robinhood Chain:

* **`CollectionShutdown` is absent.** There is no Sudoswap `PairFactory` on Ink, so neither `CollectionShutdown` nor `LinearRangeCurve` is deployed, and collections there cannot be wound down.
* **The price oracle is seeded deeper.** Ink produces a block every second and the oracle stores at most one observation per second, so each new pool is seeded with 512 observation slots — a guaranteed price window of roughly 8.5 minutes.

`flETH` here is the canonical Flayer deployment for the chain. It carries no yield strategy yet — there is no Aave V3 market on Ink — so it wraps and unwraps ETH one-to-one until one is attached.

### Protocol contracts

| Contract                             | Address                                      |
| ------------------------------------ | -------------------------------------------- |
| `Locker`                             | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, attached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, unattached)   | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| `Listings`                           | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                         | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                           | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                      | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                      | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)   | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (native token)               | `0x000000000DD39073Cfc60e7102288ccBd7Bf23fE` |
| `ProtocolFeeReceiver`                | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                            | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `RoyaltyGate`                        | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

As on Arbitrum One, the `Locker` is attached to the `WhiteGlove` gate; the `Public` gate is deployed but detached.

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32` |
| Uniswap V4 `PositionManager` | `0x1b35d13a2E2528f192637F14B05f0Dc0e7dEB566` |

{% hint style="info" %}
Ink is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/ink/...` or `/v1/57073/...`. Ink's block explorer is Blockscout, at [explorer.inkonchain.com](https://explorer.inkonchain.com).
{% endhint %}

## Arc (chain `5042`)

Arc is Circle's USDC-native L1, and the only chain where NFTX pools are not quoted in an ETH-equivalent token. USDC is the native currency — it pays for gas — and it exposes **one balance through two interfaces**: an 18-decimal native interface (`msg.value`, `address.balance`) and a 6-decimal ERC20 interface at `0x3600000000000000000000000000000000000000`. Sending `1e18` natively is the same USDC as a `1e6` ERC20 transfer. Nothing is wrapped, and there is no WETH-style wrapper on Arc because none is needed.

That split is the thing to get right when integrating:

* **Pools, liquidity and quote-token allowances use the 6-decimal ERC20.** A pool balance of `1000000` is one USDC.
* **`NFTXZap` amounts stay 18-decimal native.** `msg.value`, the ETH-named limits and return values, and royalty payments are all in native units. A payment of `1e18` buys with `1e6` ERC20 units; a payment below `1e12` is smaller than one micro-USDC and reverts.
* **Collection tokens are unchanged at 18 decimals**, and `1e18` still redeems one NFT.

Arc otherwise matches Ink and Arbitrum One:

* **`CollectionShutdown` is absent.** There is no Sudoswap `PairFactory` on Arc, so collections there cannot be wound down.
* **The price oracle is seeded deeper.** Arc produces blocks faster than once a second and the oracle stores at most one observation per second, so each new pool is seeded with 512 observation slots.

### Protocol contracts

| Contract                             | Address                                      |
| ------------------------------------ | -------------------------------------------- |
| `Locker`                             | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, attached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, unattached)   | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| `Listings`                           | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                         | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                           | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                      | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                      | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)   | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| USDC (pool quote token, 6 decimals)  | `0x3600000000000000000000000000000000000000` |
| `ProtocolFeeReceiver`                | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                            | `0xDf288b66a77f25197544877eaF4626d7E64cb5A8` |
| `RoyaltyGate`                        | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

The `Locker` is attached to the `WhiteGlove` gate, so only its owner can create and initialize collections; the `Public` gate is deployed but detached. The zap here is the chain's own deployment rather than the shared vanity address used on the ETH-quoted chains, because it is configured for USDC payments.

The address book reads `nativeToken` (and its legacy `flETH` alias) as the USDC system contract above. `NFTXZap.flETH()` returns the same address, kept as an alias so existing integrations keep compiling.

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x8366a39CC670B4001A1121B8F6A443A643e40951` |
| Uniswap V4 `PositionManager` | `0x6049c9a0e26405C0985f9E3685C87d0aE917f82B` |

{% hint style="warning" %}
The CCA Launchpad is **not** deployed on Arc. It settles team payments through Splits, and the Splits factories do not exist on that chain. Collections are created directly through the `Locker`.
{% endhint %}

{% hint style="info" %}
Arc support in the API and the app is still being rolled out; the contracts above are live and can be used directly.
{% endhint %}

## ApeChain (chain `33139`)

ApeChain's native currency is **APE**, and there is no Uniswap V4 deployment on it. So NFTX trades there on **Armory**, a byte-for-byte fork of Uniswap V3, through `NFTXArmory`: a market contract that takes the place the `NFTXV4Hook` holds on every other chain, as the `Locker`'s implementation. Vaults, listings, launches and floor tokens work exactly as they do elsewhere; what changes is the pool underneath. Deployed on 1 October 2026 (blocks `50,820,531`–`50,820,555`).

* **One pool per collection, on Armory's 1% fee tier.** Each collection token trades against **WAPE** (wrapped APE, an 18-decimal WETH9-style wrapper) in a single Uniswap V3 pool with a 1% fee and a tick spacing of 200. The pool's id, as the API and the indexers report it, is its address left-padded to 32 bytes (`NFTXArmory.getCollectionPoolId`).
* **Liquidity positions are Armory V3 NFTs.** They live on Armory's `NonfungiblePositionManager` and stay in your wallet. You can manage them through `NFTXArmory` (`mintPosition`, `increasePosition`, `collectPosition`, `withdrawPosition`, after approving `NFTXArmory` on the position manager) or directly on Armory.
* **Listing fees go to the `ProtocolFeeReceiver`, not to liquidity providers.** A Uniswap V3 pool credits a donation to whoever is in range at that instant, so a just-in-time position could capture listing fees donated to the pool. `NFTXArmory` forwards them to the protocol instead.
* **Armory can take a share of swap fees.** Armory's fee manager can switch on a protocol fee for any of its pools, ours included. Its default is one fifth of each pool's LP fees, which would leave liquidity providers 0.8% of every 1% swap. NFTX takes no fee of its own on top.
* **Launches are public, with a 5-NFT floor.** The `Locker` is attached to a `Public` launch gate: anyone may launch, the first deposit must be at least 5 NFTs, single-sided (NFT-only) launches are not allowed, and creation is free.
* **`CollectionShutdown` is absent**, as on Arbitrum One, Ink and Arc, so collections on ApeChain cannot be wound down.
* **The contracts are still owned by the deployer** (`0xB8A70b4d1547bf6193bd67A73F4F98ea9FD0A973`), not the Labs multisig.

### Protocol contracts

| Contract                                                               | Address                                      |
| ---------------------------------------------------------------------- | -------------------------------------------- |
| `Locker`                                                               | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`Public`, attached: minimum 5 NFTs, two-sided only, free) | `0xe31Cb0aF309CEE10934D42150dc3ec42a831a7Db` |
| `Listings`                                                             | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXArmory` (market, in place of `NFTXV4Hook`)                        | `0x198DCE74C3F765299a5371F89e45377172042475` |
| `LockerManager`                                                        | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                                                        | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)                                     | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| WAPE (pool quote token, 18 decimals)                                   | `0x48b62137EdfA95a428D35C09E44256a739F6B557` |
| `ProtocolFeeReceiver`                                                  | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                                                              | `0xDf288b66a77f25197544877eaF4626d7E64cb5A8` |
| `RoyaltyGate`                                                          | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

There is no `NFTXV4Hook` or `Notifier` on ApeChain. The zap is the market variant of `NFTXZap`: the same functions and the same ETH-named selectors, with every amount in native APE, and every swap routed through `NFTXArmory`. The address book reads `nativeToken` (and its legacy `flETH` alias) as WAPE, and `NFTXZap.flETH()` returns it too.

Two other launch gates exist on-chain and are not consulted: the `WhiteGlove` gate the `Locker` started with (`0xDB25A2324D2243B9624b620a33C80EfF12EC7A89`, detached on 1 October 2026), and a `Public` gate with a 10-NFT floor that was never attached (`0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B`).

### External references (Armory)

NFTX on ApeChain builds on Armory's existing deployment. These contracts are Armory's, not part of the NFTX deployment:

| Contract                                 | Address                                      |
| ---------------------------------------- | -------------------------------------------- |
| Armory V3 `Factory`                      | `0xAb52EDB039B07b0D64345Ea66696871BF33b434F` |
| Armory V3 `SwapRouter`                   | `0x4718992f1EaaB6d8A0d3c02B6Cbf25BE497bC46b` |
| Armory V3 `NonfungiblePositionManager`   | `0x75301ade925a7E7F47Cb00dE7324FF2EFAf5306a` |
| Armory V3 `QuoterV2`                     | `0xbA1EC2e1bC4795038B5D4FF931239A31776de7e0` |
| `ArmoryDexFeeManager` (V3 factory owner) | `0xb9041dbD04D2146b6F016cAc9bD01C08cB3b49Ad` |

`QuoterV2` is not a view function: it simulates the swap and reverts with the answer, so call it with `eth_call`, never in a transaction.

{% hint style="info" %}
ApeChain is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/apechain/...` or `/v1/33139/...`. Support in the app is still being rolled out; the contracts above are live and can be used directly.
{% endhint %}

## Robinhood Chain (chain `4663`)

The first chain NFTX v4 runs on outside the Ethereum family. Robinhood Chain is an Arbitrum Nitro chain with ETH as its native currency, and nothing in the protocol is specific to a chain family, so the contracts deploy unchanged. Two things differ from Ethereum Mainnet, and both matter when you build against it:

* **`CollectionShutdown` is absent.** Shutdown liquidates a vault's NFTs through a Sudoswap `PairFactory`, and Robinhood Chain has none — so neither `CollectionShutdown` nor `LinearRangeCurve` is deployed, and collections there cannot be wound down. Every other protocol surface behaves identically.
* **The price oracle is seeded deeper.** Blocks land several times a second, but the oracle stores at most one observation per second, so each new pool is seeded with 512 observation slots rather than Ethereum Mainnet's 32. That is a guaranteed price window of roughly 8.5 minutes. Longer windows are bought per pool with `increaseObservationCardinalityNext`, which anyone may call.

### Protocol contracts

| Contract                               | Address                                      |
| -------------------------------------- | -------------------------------------------- |
| `Locker`                               | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, unattached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, attached)       | `0xD8F7C0Bd089A8F42728a7CfC95B18B3636f37d75` |
| `Listings`                             | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                           | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                             | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                        | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                        | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)     | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (native token)                 | `0x00000000043C1117DAFA3A3D0C7148Eb48B30130` |
| `ProtocolFeeReceiver`                  | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                              | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `RoyaltyGate`                          | `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` |

The `Locker` is attached to the `Public` gate. Anyone may create and initialize collections, with zero creation fee, single-sided launches enabled, and a minimum deposit of one NFT. The WhiteGlove gate remains deployed but is not consulted. The switch was confirmed on 9 September 2026 in [this transaction](https://robinhoodchain.blockscout.com/tx/0x70143aafb559b2bcd780c89ad89a7047fbbdf2e882fb250e3187dccf926b7a27).

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x8366a39CC670B4001A1121B8F6A443A643e40951` |
| Uniswap V4 `PositionManager` | `0x58daec3116aae6D93017bAAea7749052E8a04fA7` |

{% hint style="info" %}
Robinhood Chain is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/robinhood/...` or `/v1/4663/...`.
{% endhint %}

## Ethereum Sepolia (chain `11155111`)

The public testnet deployment. It differs from Mainnet in three ways that matter when you build against it, all of them deliberate:

* **Launches are open to anyone.** Mainnet is still gated by `WhiteGlove`, which only its owner may launch through. Sepolia has progressed to the `Public` gate, so any address can launch a collection. Its floor is ten token IDs and creation is free.
* **`flETH` is a mock.** There is no canonical flETH on Sepolia, so the deploy script ships a `FlETHMock` in its place. It wraps and unwraps like the real thing but carries no staking yield.
* **`CollectionShutdown` is absent.** Shutdown liquidates through a Sudoswap `PairFactory`, and Sepolia has none — so neither it nor `LinearRangeCurve` is deployed, and collections there cannot be wound down.

### Protocol contracts

| Contract                               | Address                                      |
| -------------------------------------- | -------------------------------------------- |
| `Locker`                               | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`Public`, attached)       | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| Launch Gate (`WhiteGlove`, unattached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| `Listings`                             | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                           | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                             | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                        | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                        | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)     | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (`FlETHMock`)                  | `0xB8A21A638e2199D0f6f45273EB0CD286F14a9b73` |
| `ProtocolFeeReceiver`                  | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                              | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `TestERC721Factory`                    | `0x528CB4bF86B509cfB72377E45CE9F1e91826663c` |

Both launch-gate rows are listed because both contracts exist on-chain. The `Locker` is attached to the `Public` one; the `WhiteGlove` gate is deployed but detached, and launching does not consult it.

### Minting a test collection

`TestERC721Factory` is a permissionless helper for creating ERC-721s to test against. `createAndMint` deploys a collection and mints a contiguous run in one transaction, returning the collection and the **first** token ID — the recipient ends up holding `[firstTokenId, firstTokenId + mintCount)`.

```bash
# Ten tokens, which is exactly the Public gate's launch floor
cast send 0x528CB4bF86B509cfB72377E45CE9F1e91826663c \
  'createAndMint(string,string,string,address,uint256)(address,uint256)' \
  'Test Collection' 'TEST' 'https://example.com/metadata/' $YOUR_ADDRESS 10 \
  --rpc-url $SEPOLIA_RPC --private-key $YOUR_KEY
```

`collectionsOf(address)` lists everything an address has created through the factory, and the deployed collection exposes `mintManyTo(address,uint256)` for topping it up later. The factory is testnet-only by design — it has no access control, and it is never deployed to Mainnet.

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0xE03A1074c86CFeDd5C142C4F04F1a1536e203543` |
| Uniswap V4 `PositionManager` | `0x429ba70129df741B2Ca2a85BC3A2a3328e5c09b4` |

{% hint style="info" %}
Ethereum Sepolia is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/sepolia/...` or `/v1/11155111/...`.
{% endhint %}

## Robinhood Chain Testnet (chain `46630`)

The Robinhood Chain testnet deployment. It carries the same address book and the same two differences from Ethereum Mainnet as Robinhood Chain — no `CollectionShutdown`, and a 512-slot oracle seed — plus the two that come with being a testnet:

* **`flETH` is a mock.** There is no canonical flETH on this chain, so the deploy script ships a `FlETHMock` in its place. It wraps and unwraps like the real thing but carries no staking yield. It shares an address with the mock on Ethereum Sepolia, because it too is deployed through CREATE3.
* **Launches are gated.** The `Locker` is attached to the `WhiteGlove` gate, which only its owner may launch through. Ethereum Sepolia has progressed to the `Public` gate; this chain has not.

### Protocol contracts

| Contract                             | Address                                      |
| ------------------------------------ | -------------------------------------------- |
| `Locker`                             | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` |
| Launch Gate (`WhiteGlove`, attached) | `0xDB25A2324D2243B9624b620a33C80EfF12EC7A89` |
| Launch Gate (`Public`, unattached)   | `0x8b97Df0d72482f073D9EFb3ad5B534fCd55D735B` |
| `Listings`                           | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` |
| `NFTXV4Hook`                         | `0xaa49ADaDD33c5E953b645567AFb10CBbba63afC4` |
| `Notifier`                           | `0x925e3415E35C0e8a4665691B89c1564b94fEDD1b` |
| `LockerManager`                      | `0xFadAC7b454971420b90091AB5807Eb8542b77886` |
| `TaxCalculator`                      | `0x7592380231c49CA44b6340327D0c4a03C0380459` |
| `CollectionToken` (implementation)   | `0x901124cb73e1E996280f9d763C7EC8bB3D764ba6` |
| `flETH` (`FlETHMock`)                | `0xB8A21A638e2199D0f6f45273EB0CD286F14a9b73` |
| `ProtocolFeeReceiver`                | `0x1a18ab9c51CBb1EbB60a6f0D13d594F78a351559` |
| `NFTXZap`                            | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| `TestERC721Factory`                  | `0x528CB4bF86B509cfB72377E45CE9F1e91826663c` |

`TestERC721Factory` carries the same address here as on Ethereum Sepolia, so the [minting example above](#minting-a-test-collection) applies verbatim — point `--rpc-url` at a Robinhood Chain Testnet endpoint instead.

### External references (Uniswap V4)

| Contract                     | Address                                      |
| ---------------------------- | -------------------------------------------- |
| Uniswap V4 `PoolManager`     | `0x8366a39CC670B4001A1121B8F6A443A643e40951` |
| Uniswap V4 `PositionManager` | `0x58daec3116aae6D93017bAAea7749052E8a04fA7` |

{% hint style="info" %}
Robinhood Chain Testnet is served by both the [NFTX v4 API](/api-reference/api-reference) and the subgraph — reach it as `/v1/robinhood-testnet/...` or `/v1/46630/...`. Indexing this chain runs over plain RPC rather than the indexer's usual source, so it trails the chain head further than the others; treat freshly written state as eventually consistent.
{% endhint %}

## Earlier deployments: Base

These Base deployments predate the current generation. They were deployed under a different salt namespace, so none of their addresses match the chains above, and the contract set differs — the earlier Base Mainnet deployment has no launch gate, `Notifier` or `ProtocolFeeReceiver`, because those postdate it.

Base Mainnet has since been redeployed; the addresses to build against are in the [Base Mainnet](#base-mainnet-chain-8453) section above. The earlier contracts remain on-chain, and their addresses are recorded here so anything still pointed at them can be identified, not because they are a supported integration target. Neither they nor Base Sepolia are served by the [NFTX v4 API](/api-reference/api-reference) or indexed by the subgraph.

### Base Mainnet, earlier generation (chain `8453`)

{% hint style="danger" %}
Superseded. Do not create or initialize collections against this `Locker`: it has no launch gate, and its collection-creation fee is paid to an address nobody controls.
{% endhint %}

| Contract                           | Address                                      |
| ---------------------------------- | -------------------------------------------- |
| `Locker`                           | `0xd9966d9803fA761B0d8C9E5Fc602f2e5cbf1431A` |
| `Listings`                         | `0x41044Ee18031bb27f401F3d8F4624Ea096cF63eF` |
| `NFTXV4Hook`                       | `0x3b47FE7C08b64bA6F82Ccb77Cdb2dA2E4FbdafCc` |
| `LockerManager`                    | `0x02887b661C2eD65a20774377a71B0F3290C0514c` |
| `TaxCalculator`                    | `0xd435316180F37eD5B697812B6919F9d8c5FA12b2` |
| `CollectionToken` (implementation) | `0x6E715ff62E4854a99b6848Bbe92834034CBaaB48` |
| `flETH` (native token)             | `0x000000000D564D5be76f7f0d28fE52605afC7Cf8` |
| `CollectionShutdown`               | `0x046f370cc94218c6A4A0F051562Eb74a2e4Dc321` |
| `LinearRangeCurve`                 | `0x05D0Ad1366491803F6396f50EAc57aE19D9f3148` |
| `TokenGovernorFactory`             | `0x2b8F9818efcc2bBA2128E1aCA51A4198c93fe5fE` |
| `NFTXZap`                          | `0xC20C175A8C36e716Ed16fd481b139e96dD201108` |

### Base Sepolia (chain `84532`)

| Contract                           | Address                                      |
| ---------------------------------- | -------------------------------------------- |
| `Locker`                           | `0xdf40DdFc68f608E52794ae617534478125c63C84` |
| Launch Gate (`WhiteGlove`)         | `0xfA57662C286385c4946751Ac0be8A5Bd6F55852B` |
| `Listings`                         | `0x6F7B74B518456C5edeE88AC9D19aBC25A8284c7a` |
| `NFTXV4Hook`                       | `0x32D550542268d22Ee1fD35d392780f4C729A2fCC` |
| `LockerManager`                    | `0xE8C6B807d4d036828d92923eb31162d51430909E` |
| `TaxCalculator`                    | `0x28a1124E607032A00f393a6c1d7e59AFBFd34319` |
| `CollectionToken` (implementation) | `0x06c203495b3090f5A8a73eCDA79Bac54f60E7220` |
| `flETH` (`FlETHMock`)              | `0xD2AeC1992b576762726a4e0a201df18D28BF06A6` |
| `NFTXZap`                          | `0xf827bd28f5CA9DD6c2262eDaF7E3F2481c437C7C` |
| `TestERC721Factory`                | `0xA1a70A903c04f2906c6b45A1e9b90711982932FB` |

## Deterministic deployment (CREATE3)

The contracts are deployed deterministically through the CreateX factory, so integrators can verify addresses independently. These three values produce the shared address book on the nine current chains — not on the earlier Base deployments, which used a different salt namespace. On ApeChain, `NFTXArmory` deploys under its own salt in the same namespace, and the `Public` launch gate under the namespace `nftx.v3.apechain`, so neither shares an address with another chain:

| Field               | Value                                                                                  |
| ------------------- | -------------------------------------------------------------------------------------- |
| CreateX factory     | `0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed`                                           |
| Deployer            | `0xB8A70b4d1547bf6193bd67A73F4F98ea9FD0A973`                                           |
| Salt namespace      | `nftx.v3`                                                                              |
| `NFTXV4Hook` salt   | `0xb8a70b4d1547bf6193bd67a73f4f98ea9fd0a97300115c6351c7f0065d460482`                   |
| `NFTXFlexHook` salt | `0xb8a70b4d1547bf6193bd67a73f4f98ea9fd0a97300d5058ee1744140af470ce5` (iteration 14037) |
| `RoyaltyGate` salt  | `0xb8a70b4d1547bf6193bd67a73f4f98ea9fd0a973008c6b37b66a57a0c7107b0a`                   |


# Creator Token Approvals

How ERC721-C collections work with NFTX: allow NFTX's operators for feeless trading, or enforce creator royalties through the Royalty Gate.

An ERC721-C collection decides, through its transfer validator, which contracts may move its NFTs. There are two ways to set one up for NFTX:

|                                | Allow NFTX's operators                                  | Enforce royalties with the Royalty Gate                                           |
| ------------------------------ | ------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Configure                      | Whitelist **Locker, Listings and NFTXZap** as operators | List the **Royalty Gate** as an authorizer; keep the Locker **off** the whitelist |
| Royalty on NFTX                | None: feeless in and out                                | Paid on every NFT entering the vault                                              |
| Deposits and sales             | Free                                                    | Through the gate, less the royalty                                                |
| Buys, redeems, listing fills   | Free                                                    | Free                                                                              |
| Listings and NFT-for-NFT swaps | Available                                               | Not available yet                                                                 |
| Status                         | Live                                                    | Live on every mainnet; each collection opts in                                    |

Either way this is a **collection-admin configuration**. Holders still approve the contract used by their transaction with ERC-721 `approve` or `setApprovalForAll`. A holder's approval cannot override a transfer-validator rejection.

The rest of this page covers the operator allowlist first, then [enforced royalties](#enforced-royalties-with-the-royalty-gate).

## Allow NFTX's operators

Ask the collection's developer team to allow **Locker, Listings, and NFTXZap** as operators in the collection's active transfer-validator policy on the chain where the collection is deployed. These three contracts cover NFTX's standard deposit, redeem, swap, listing, and ETH-to-NFT trading flows.

### Addresses to send to the collection team

The addresses match across the six current deployments, but validator settings are chain-specific. Configure each chain separately if the collection exists on more than one chain. Testnet approvals do not carry over to mainnet.

| Chain                      | Chain ID   | Locker                                       | Listings                                     | NFTXZap                                      |
| -------------------------- | ---------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| Ethereum Mainnet           | `1`        | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| Arbitrum One               | `42161`    | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| Ink                        | `57073`    | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| Arc                        | `5042`     | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0xDf288b66a77f25197544877eaF4626d7E64cb5A8` |
| ApeChain                   | `33139`    | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0xDf288b66a77f25197544877eaF4626d7E64cb5A8` |
| Robinhood Chain            | `4663`     | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| Ethereum Sepolia (testnet) | `11155111` | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |
| Robinhood Chain Testnet    | `46630`    | `0xb4C5b5235b98114E9DC227b54e088C11680b2385` | `0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae` | `0x000000144106C1BfC69fBbD04D56220e1A0A9A3C` |

Copyable operator list for any one of those chains:

```json
[
  "0xb4C5b5235b98114E9DC227b54e088C11680b2385",
  "0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae",
  "0x000000144106C1BfC69fBbD04D56220e1A0A9A3C"
]
```

Arc and ApeChain run a different `NFTXZap`: Arc's is configured for USDC payments, and ApeChain's pays in native APE and swaps through `NFTXArmory`. Use this list on either of them instead:

```json
[
  "0xb4C5b5235b98114E9DC227b54e088C11680b2385",
  "0x11F09e7eeD242FAd875D3565B3D9CA8AADE445ae",
  "0xDf288b66a77f25197544877eaF4626d7E64cb5A8"
]
```

Addresses checked against the protocol's deployment JSON manifests on **9 September 2026**. The [deployment reference](/contracts/addresses) includes explorer links and external dependencies. Earlier Base deployments use different addresses and are outside this table.

### Why these operators are required

The operator is the contract that calls the NFT's transfer function, even when a transaction enters through another NFTX contract.

| Flow                                | NFT movement                                    | Operators checked                   |
| ----------------------------------- | ----------------------------------------------- | ----------------------------------- |
| Deposit or seed a collection        | Holder → Locker                                 | Locker                              |
| Redeem                              | Locker → recipient                              | None: the Locker sends as the owner |
| Swap                                | Incoming NFT → Locker; outgoing NFT → recipient | Locker on the way in                |
| Create a listing                    | Holder → Listings → Locker                      | Listings, then Locker               |
| Sell an NFT for ETH through the Zap | Holder → NFTXZap → Locker                       | NFTXZap, then Locker                |
| Buy an NFT through the Zap          | Locker → buyer                                  | None: the Locker sends as the owner |

Listings and NFTXZap hold incoming NFTs temporarily; Locker holds vaulted NFTs. If the collection's policy also restricts contract receivers, check that all three can receive NFTs. Operator permission alone may not satisfy every policy. Validate outbound transfers too, including delivery to a buyer's smart wallet.

The collection's ERC-20 token, flETH, Permit2, PoolManager, and NFTX hooks are not additional NFT operators for these standard flows. ERC-20 allowances used for payment are separate.

### Collection-team setup

1. Read `getTransferValidator()` on the NFT collection and identify its validator version and currently attached policy/list. Use that validator's admin tools or verified ABI; the setup functions differ between versions.
2. From the account authorized to manage the collection policy and its list, add the three addresses above as allowed **operators**. If the collection uses a shared list your team cannot edit, create or copy a list your team controls, preserve the existing entries, and attach it to the collection.
3. Review receiver restrictions for Locker, Listings, and NFTXZap. Preserve the collection's intended policy and any existing marketplace permissions.
4. Read the policy back and simulate the transfer paths below before announcing that the collection is ready. Record the chain ID, collection address, validator address, list/policy ID, and configuration transaction hashes.

Limit Break's [transfer-validator documentation](https://github.com/limitbreakinc/creator-token-transfer-validator) explains the current rulesets and lists; older collections may use the [earlier creator-token validator](https://github.com/limitbreakinc/creator-token-contracts/blob/main/contracts/utils/CreatorTokenTransferValidator.sol). Being tradable on OpenSea does not establish permission for NFTX's operators.

{% hint style="info" %}
Allowlisting NFTX's operators does not enforce a royalty: deposits and sales through them are royalty-free. To enforce one, use the [Royalty Gate](#enforced-royalties-with-the-royalty-gate) instead.
{% endhint %}

### Verify the integration

Use a local fork with representative owned token IDs and the same holder approvals as the frontend. Exercise a deposit and redeem, listing creation and purchase, an NFT sale through NFTXZap, and a swap. Verify final NFT ownership as well as transaction success. Include smart-wallet recipients when supported.

A rejected deposit points to the Locker transfer or receiver policy. A rejected listing can occur on either the holder → Listings or Listings → Locker leg. A rejected Zap sale can occur on either holder → NFTXZap or NFTXZap → Locker. Capture the revert from the collection/validator and check the actual operator, source, and destination before changing permissions. Missing holder approval, paused transfers, frozen tokens, and receiver restrictions require different fixes.

### Optional integrations

The three-address list covers the standard NFTX trading routes. Review these additional paths separately when enabling them:

* [**Legacy migration**](/contracts/migrator-zap) **(Ethereum Mainnet):** the legacy vault transfers NFTs to MigratorZap (`0x08222EA6aBe9111b77cf006Dc7F0a7c71fcCF390`), then Locker pulls them into v4. Check the selected legacy vault as operator and MigratorZap as receiver; MigratorZap's role as transaction entry point does not make it the NFT transfer operator on these legs.
* [**Collection shutdown**](/contracts/collection-shutdown)**:** Locker sends NFTs to CollectionShutdown, and the Sudoswap factory transfers them into a newly created liquidation pair. Review the factory/pair operators and shutdown/pair receivers on the relevant chain. The pair is created for that shutdown, so there is no universal fixed three-address list covering liquidation.

## Enforced royalties with the Royalty Gate

Instead of allowing the Locker to pull NFTs freely, a collection can make every entry into the vault go through the [Royalty Gate](/contracts/royalty-gate), which pays the collection's ERC-2981 royalty. [Creator Royalties](/how-it-works/creator-royalties) explains what this means for traders.

The Royalty Gate is at `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F` on every mainnet (Ethereum, Base, Arbitrum One, Ink, Arc, ApeChain and Robinhood Chain). That is `$ROYALTY_GATE` in the commands below, and the Locker (`0xb4C5b5235b98114E9DC227b54e088C11680b2385`) is `$LOCKER`.

### What to configure

1. **List the Royalty Gate as an authorizer** on the collection's list. An authorizer can give one-time permission for specific tokens; the gate uses it only for NFTs it's depositing, and clears it straight after.
2. **Keep the Locker off the operator whitelist.** A whitelisted Locker lets anyone deposit around the gate. Remove it if it's already there, and check for a codehash entry on Limit Break v3 too.
3. **Use a list the collection owns alone.** Shared lists (for example a list several collections on one chain point at) can't drop the Locker for one collection without dropping it for all. Create a list, copy across the operators the collection still wants, and apply it to the collection.
4. **Keep over-the-counter transfers enabled.** The Locker sends NFTs out as their owner. Security levels 4, 7 and 8 block owner transfers and level 9 blocks all transfers, so nothing could leave the vault; the gate refuses entries at those levels.

The validator settings differ between versions:

{% tabs %}
{% tab title="OpenSea strict registry" %}
Registry `0xA000027A9B2802E1ddf7000061001e5c005A0000`. Level 3, with authorization and wildcard **enabled**:

```sh
cast send $VALIDATOR "addAccountsToAuthorizers(uint120,address[])" $LIST "[$ROYALTY_GATE]"
cast send $VALIDATOR "removeAccountsFromWhitelist(uint120,address[])" $LIST "[$LOCKER]"
cast send $VALIDATOR "setTransferSecurityLevelOfCollection(address,uint8,bool,bool,bool)" $COLLECTION 3 true true false
```

{% endtab %}

{% tab title="Limit Break v3" %}
Validator `0x721C002B0059009a671D00aD1700c9748146cd1B`. Level 3, with authorization mode **not disabled** (v3's flags are *disables*; wildcard operators may stay either way):

```sh
cast send $VALIDATOR "addAccountsToAuthorizers(uint120,address[])" $LIST "[$ROYALTY_GATE]"
cast send $VALIDATOR "removeAccountsFromWhitelist(uint120,address[])" $LIST "[$LOCKER]"
cast send $VALIDATOR "setTransferSecurityLevelOfCollection(address,uint8,bool,bool,bool)" $COLLECTION 3 false false false
```

{% endtab %}
{% endtabs %}

Run these from the account that owns the list and administers the collection. Validators without authorizers (Limit Break v1 and v2, OpenSea's Operator Filter Registry) can't host the gate; move the collection to one of the two above first.

### Check it worked

Read both views on the Royalty Gate:

* `isAuthorizerFor(collection)` must return `true`.
* `isBypassable(collection)` must return `false`.

When both hold, the NFTX app routes the collection's deposits and sales through the gate and shows traders the royalty. If `isBypassable` is `true`, the Locker can still pull the collection's NFTs directly, so the royalty is voluntary. On a fork, confirm that a plain `Locker.deposit` reverts, that a deposit through the gate pays the receiver `royaltyInfo(tokenId, 1e18)` in floor tokens, and that a redeem still delivers the NFT.

### What stops working

Every path where the Locker pulls an NFT directly reverts for an enforced collection: `Locker.deposit`, `Locker.swap` and `swapBatch`, `Listings.createListings`, `NFTXZap.sellNFTForETH`, and `Locker.initializeCollection`. Set up the vault **before** switching enforcement on. Exits keep working: redeems, buys through the Zap, and listing fills and cancels. Collection shutdown hands the NFTs to a liquidation pool, whose own pull needs the gate or a temporary whitelist entry.

To switch enforcement off, whitelist the Locker again. The gate keeps working as a voluntary route.

## Deployment and implementation sources

This table uses protocol revision [`e26724c`](https://github.com/flayerlabs/nftx-v4-protocol/tree/e26724caf6fa074c20002db4ae174f636d68350b).

* [Ethereum Mainnet deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-1.json)
* [Arbitrum One deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-42161.json)
* [Ink deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-57073.json)
* [Arc deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/804c2d0/deployments/deployment-5042.json)
* [ApeChain deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/878bafb/deployments/deployment-33139.json)
* [Robinhood Chain deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-4663.json)
* [Ethereum Sepolia (testnet) deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-11155111.json)
* [Robinhood Chain Testnet deployment](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/deployments/deployment-46630.json)

Transfer paths: [Locker](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/src/contracts/Locker.sol), [Listings](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/src/contracts/Listings.sol), [NFTXZap](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/src/contracts/zaps/NFTXZap.sol), and [NFTTransferLib](https://github.com/flayerlabs/nftx-v4-protocol/blob/e26724caf6fa074c20002db4ae174f636d68350b/src/contracts/libraries/NFTTransferLib.sol).

When an operator is redeployed, update this table and the deployment reference, and arrange collection-team approval of the replacement before routing users through it.


# Royalty Gate

The royalty-charging entrance to the Locker for ERC721-C collections that enforce creator royalties on NFTX.

`RoyaltyGate` lets an ERC721-C collection enforce its ERC-2981 creator royalty on NFTX without any change to the Locker, the hooks, Listings, or the Zap. The collection's creator lists the gate as an **authorizer** on the collection's transfer validator and leaves the Locker **off** its operator whitelist. From then on, every NFT that enters the vault comes through the gate, and the gate pays the royalty.

The gate has no owner and holds nothing between transactions. It works on any registered collection; where a collection hasn't enforced royalties, entries through the gate pay the royalty voluntarily.

{% hint style="info" %}
The Royalty Gate is live on every mainnet at `0xB1C4E21393b3F9A3f75F3a7c7AbC18Cd07FBba4F`: Ethereum, Base, Arbitrum One, Ink, Arc, ApeChain and Robinhood Chain. It isn't deployed on the testnets. See the [Deployment Addresses](/contracts/addresses).
{% endhint %}

Signatures, events and errors below come from the `IRoyaltyGate` interface, which integrators should build against.

## Why enforcement lives on the way in

ERC721-C validators decide who may move a collection's NFTs. Two kinds of transfer reach them, and they're treated very differently:

* **Operator transfers** (`caller != from`) are checked against the collection's operator whitelist, or a temporary grant from a listed authorizer. The Locker pulls NFTs this way on every deposit.
* **Owner transfers** (`caller == from`) are allowed at every security level that permits over-the-counter (OTC) transfers. The Locker sends NFTs this way on every exit: redeems, listing fills and cancels, and shutdowns.

So a validator can gate the way **in** but never the way **out**. With the Locker off the whitelist, each transfer is admitted like this:

| Transfer                                         | Caller | From   | Admitted because                            |
| ------------------------------------------------ | ------ | ------ | ------------------------------------------- |
| Holder → gate                                    | gate   | holder | the gate's temporary grant                  |
| Gate → Locker (deposit)                          | Locker | gate   | the same grant, which also names the Locker |
| Locker → anyone (redeem, fill, cancel, shutdown) | Locker | Locker | an owner moving its own NFT                 |
| Bare `Locker.deposit`                            | Locker | holder | nothing: refused                            |

Behind the scenes, the gate grants permission for exactly the token IDs being deposited, and for the operator doing the pulling, just before the gate pulls them. It clears every grant as soon as the Locker holds the NFTs. If the validator refuses to clear a grant the gate made, the whole entry reverts (`AuthorizationNotCleared`), so no permission outlives the deposit. The gate only ever pulls from the caller, so it can't move an NFT its caller doesn't own.

## What the royalty is

One NFT entering the vault mints one whole floor token, so the gate prices each NFT at `1e18` and pays every receiver `royaltyInfo(tokenId, 1e18)` in floor tokens. Royalties are read per token and combined per receiver, so a collection with different receivers for different tokens pays each of them for their own tokens.

For example: a collection with a 9% royalty. Depositing one NFT mints 1 floor token; 0.09 goes to the creator and 0.91 to the depositor.

* The depositor pays, as ERC-2981 intends for a seller. Each NFT pays once per trip into the vault; buying it back out is free.
* A royalty can never exceed the floor it's charged on. A collection whose `royaltyInfo` reverts, or names nobody, owes nothing.
* Floor tokens have no transfer hook, so no receiver can block an entry.

## Entry points

### `deposit`

Deposits the caller's NFTs, pays the royalty out of the minted floor tokens, and sends the rest to `_recipient`. The caller must have approved the gate for the token IDs.

```solidity
function deposit(address _collection, uint[] calldata _tokenIds, address _recipient, uint _minTokensOut) external returns (uint tokensOut_);
```

| Parameter       | Type      | Description                                                                                          |
| --------------- | --------- | ---------------------------------------------------------------------------------------------------- |
| `_collection`   | `address` | The ERC721 collection                                                                                |
| `_tokenIds`     | `uint[]`  | The IDs to deposit, owned by the caller                                                              |
| `_recipient`    | `address` | Receives the floor tokens left after royalties                                                       |
| `_minTokensOut` | `uint`    | Reverts `InsufficientOutput` if the recipient would receive less. Pass `quoteDeposit`'s first return |

| Return       | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| `tokensOut_` | `uint` | Floor tokens sent to `_recipient` |

### `sellNFTsForETH`

Deposits the caller's NFTs, pays the royalty as `deposit` does, sells the rest for ETH through the [Zap](/contracts/zap) and pays the caller. Flow: `NFT → gate → Locker → royalty paid in floor tokens → remainder sold for ETH`.

```solidity
function sellNFTsForETH(address _collection, uint[] calldata _tokenIds, uint _minETHReceived) external returns (uint ethReceived_);
```

| Parameter         | Type      | Description                                                                                                                             |
| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `_collection`     | `address` | The ERC721 collection                                                                                                                   |
| `_tokenIds`       | `uint[]`  | The IDs to sell, owned by the caller                                                                                                    |
| `_minETHReceived` | `uint`    | Reverts `InsufficientOutput` if the caller would receive less. Quote it on the floor tokens left after the royalty, not on whole tokens |

| Return         | Type   | Description            |
| -------------- | ------ | ---------------------- |
| `ethReceived_` | `uint` | ETH sent to the caller |

## Views

### `quoteDeposit`

What `deposit` would pay out at the collection's current royalty terms.

```solidity
function quoteDeposit(address _collection, uint[] calldata _tokenIds) external view returns (uint tokensOut_, uint royalty_);
```

| Return       | Type   | Description                                     |
| ------------ | ------ | ----------------------------------------------- |
| `tokensOut_` | `uint` | Floor tokens the recipient would receive        |
| `royalty_`   | `uint` | Floor tokens that would go to royalty receivers |

### `isAuthorizerFor`

Whether the collection lists this gate as an authorizer on its transfer validator. Never reverts.

```solidity
function isAuthorizerFor(address _collection) external view returns (bool);
```

### `isBypassable`

Whether the Locker can still pull the collection's NFTs without the gate, which makes the royalty voluntary. Never reverts, and reads `true` whenever it can't tell.

```solidity
function isBypassable(address _collection) external view returns (bool);
```

It answers in this order:

1. No transfer validator: bypassable.
2. The collection's own `isTransferAllowed(locker, holder, locker)`, where the collection has one (Creator Token Standards collections do).
3. The validator's policy: security level 1 (no restrictions), or level 2 (a blacklist) without the Locker on it, is bypassable.
4. Otherwise the Locker whitelisted by address, or by codehash on Limit Break v3, is bypassable.

**A collection enforces royalties on NFTX when `isAuthorizerFor` is `true` and `isBypassable` is `false`.** That's the check the NFTX app uses to route a collection through the gate.

### `locker` / `zap`

The Locker every entry is deposited into, and the Zap `sellNFTsForETH` sells through. Both are fixed at deployment: the Locker is the same on every chain, and the Zap is each chain's `NFTXZap` from the [Deployment Addresses](/contracts/addresses).

## Events

| Event                                                                                                                                      | Emitted when                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
| `RoyaltyPaid(address indexed _collection, address indexed _receiver, uint _amount)`                                                        | Once per distinct royalty receiver on an entry, in floor tokens |
| `GatedDeposit(address indexed _collection, uint[] _tokenIds, address indexed _sender, address _recipient, uint _tokensOut, uint _royalty)` | NFTs enter through `deposit`                                    |
| `GatedSale(address indexed _collection, uint[] _tokenIds, address indexed _seller, uint _ethReceived, uint _royalty)`                      | NFTs enter through `sellNFTsForETH`                             |

## Errors

| Error                              | Cause                                                                                                                                    |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `NoTokenIds()`                     | No token IDs given                                                                                                                       |
| `ZeroAddress()`                    | A zero recipient                                                                                                                         |
| `CollectionNotRegistered(address)` | The collection has no floor token on the Locker                                                                                          |
| `InsufficientOutput(uint, uint)`   | The payout fell below the caller's minimum                                                                                               |
| `UnauthorizedETHSender()`          | ETH arrived from anything but the Zap                                                                                                    |
| `AuthorizationNotCleared(address)` | The validator refused to clear a grant the gate made                                                                                     |
| `ExitsBlocked(address, uint)`      | The collection's security level (4, 7, 8 or 9) blocks owner transfers, so a vaulted NFT could never leave. The gate refuses to let it in |

## Supported validators

| Validator                                          | Address                                      | Notes                                                      |
| -------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------- |
| OpenSea `StrictAuthorizedTransferSecurityRegistry` | `0xA000027A9B2802E1ddf7000061001e5c005A0000` | Level 3 with authorization and wildcard enabled            |
| Limit Break `CreatorTokenTransferValidator` v3     | `0x721C002B0059009a671D00aD1700c9748146cd1B` | Authorization mode on; wildcard operators may be on or off |

Both token-ID-based and older caller-only collections work on both. Validators without authorizers (Limit Break v1 and v2, OpenSea's Operator Filter Registry) can't host the gate; a collection on one of them would first move to a supported validator. See [Creator Token Approvals](/contracts/creator-token-approvals#enforced-royalties-with-the-royalty-gate) for the onboarding steps.

## Launchpad collections

New launchpad collections created with an enforced template list the gate as an authorizer and never whitelist the Locker, so their royalties are enforced on NFTX from the first trade. The launchpad and its settlement contract move the NFTs they mint straight into the vault without the gate. A holder-rewards variant names the collection itself as its royalty receiver: floor-token royalties from the gate collect on the collection until anyone sells them for ETH (at no less than the pool's 30-minute TWAP, minus 5%) and stream that ETH to holders.

## Sources

Implementation: [`RoyaltyGate.sol`](https://github.com/flayerlabs/nftx-v4-protocol/blob/main/src/contracts/utils/RoyaltyGate.sol) and [`IRoyaltyGate.sol`](https://github.com/flayerlabs/nftx-v4-protocol/blob/main/src/interfaces/utils/IRoyaltyGate.sol). The design notes, including what the gate can and can't enforce, are in [`ROYALTIES.md`](https://github.com/flayerlabs/nftx-v4-protocol/blob/main/ROYALTIES.md).


# Locker

The vault at the center of NFTX v4 — custodies NFTs, mints collection tokens, and exposes deposit, redeem, and swap.

The `Locker` holds every deposited ERC-721 and issues a fungible ERC-20 **collection token** in return. It deliberately separates token storage from listing logic so that listing managers can be upgraded without migrating the NFTs themselves. Manager contracts must be approved for token access; when a vault is removed, those permissions are revoked.

Function signatures and parameter descriptions below come from the `ILocker` interface. Entry and exit (`deposit` / `redeem`) are feeless — fees live in the [Listings](/contracts/listings) and [Hook](/contracts/nftx-v4-hook) layers.

## Core vault operations

### `deposit`

Takes approved ERC-721s from the caller and mints the ERC-20 equivalent (one collection token per NFT). The recipient overload sends the minted tokens to a different address.

```solidity
function deposit(address _collection, uint[] calldata _tokenIds) external;
function deposit(address _collection, uint[] calldata _tokenIds, address _recipient) external;
```

**Access:** `nonReentrant`, `whenNotPaused`, collection must exist.

| Parameter     | Type      | Description                                                |
| ------------- | --------- | ---------------------------------------------------------- |
| `_collection` | `address` | The address of the token collection                        |
| `_tokenIds`   | `uint[]`  | The IDs of the tokens being deposited                      |
| `_recipient`  | `address` | The address receiving the ERC-20 (recipient overload only) |

{% hint style="info" %}
For an ERC721-C collection that enforces royalties on NFTX, the collection's validator refuses this pull. Deposit through the [Royalty Gate](/contracts/royalty-gate) instead.
{% endhint %}

**Returns:** None.

### `redeem`

Burns collection tokens and returns specific ERC-721s to the caller (or a recipient). Reverts if any requested token is an active listing rather than a floor item.

```solidity
function redeem(address _collection, uint[] calldata _tokenIds) external;
function redeem(address _collection, uint[] calldata _tokenIds, address _recipient) external;
```

**Access:** `nonReentrant`, `whenNotPaused`, collection must exist.

| Parameter     | Type      | Description                                                  |
| ------------- | --------- | ------------------------------------------------------------ |
| `_collection` | `address` | The address of the token collection                          |
| `_tokenIds`   | `uint[]`  | The IDs of the tokens being redeemed                         |
| `_recipient`  | `address` | The address receiving the ERC-721s (recipient overload only) |

**Returns:** None.

### `swap`

Swaps a token held by the caller for a floor token in the vault in a single call — effectively a combined `deposit` and `redeem`, more gas-efficient than running both. The token being redeemed must be of floor value, not a listing.

```solidity
function swap(address _collection, uint _tokenIdIn, uint _tokenIdOut) external;
```

**Access:** `nonReentrant`, `whenNotPaused`, collection must exist. Reverts if `_tokenIdIn == _tokenIdOut` or if `_tokenIdOut` is an active listing.

| Parameter     | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `_collection` | `address` | The address of the token collection   |
| `_tokenIdIn`  | `uint`    | The ID of the token being swapped in  |
| `_tokenIdOut` | `uint`    | The ID of the token being swapped out |

**Returns:** None.

### `swapBatch`

The batched form of `swap` — exchanges a set of tokens for an equal-sized set of floor tokens from the same collection in one call.

```solidity
function swapBatch(address _collection, uint[] calldata _tokenIdsIn, uint[] calldata _tokenIdsOut) external;
```

**Access:** `nonReentrant`, `whenNotPaused`, collection must exist. Reverts if the input and output arrays differ in length, or if any output token is an active listing.

| Parameter      | Type      | Description                             |
| -------------- | --------- | --------------------------------------- |
| `_collection`  | `address` | The address of the token collection     |
| `_tokenIdsIn`  | `uint[]`  | The IDs of the tokens being swapped in  |
| `_tokenIdsOut` | `uint[]`  | The IDs of the tokens being swapped out |

**Returns:** None.

## Collection lifecycle

### `createCollection`

Registers a collection and deploys its underlying `CollectionToken` clone. When a launch gate is set, the gate decides who may create a collection at the current stage; when unset, anyone can register a collection by paying the `collectionCreationFee`.

```solidity
function createCollection(address _collection, string calldata _name, string calldata _symbol) external payable returns (address);
```

**Access:** `payable`, `whenNotPaused`, `nonReentrant`. Reverts if `msg.value` doesn't match the creation fee, if the collection already exists or was previously sunset, or if it isn't a valid ERC-721.

| Parameter     | Type      | Description                         |
| ------------- | --------- | ----------------------------------- |
| `_collection` | `address` | The address of the token collection |
| `_name`       | `string`  | The name of the ERC-20 token        |
| `_symbol`     | `string`  | The symbol for the ERC-20 token     |

| Return    | Type      | Description                              |
| --------- | --------- | ---------------------------------------- |
| (unnamed) | `address` | The address of the ERC-20 token deployed |

### `initializeCollection`

Sets a base price and injects the collection's initial liquidity into the Uniswap V4 pool. Requires at least `MINIMUM_TOKEN_IDS` (10) NFTs; any unused collection-token headroom from `_tokenSlippage` is refunded to the caller.

```solidity
function initializeCollection(address _collection, uint _eth, uint[] calldata _tokenIds, uint _tokenSlippage, uint160 _sqrtPriceX96) external;
```

**Access:** `nonReentrant`, `whenNotPaused`, collection must exist. Reverts if the collection is already initialized or fewer than 10 token IDs are supplied.

| Parameter        | Type      | Description                                                          |
| ---------------- | --------- | -------------------------------------------------------------------- |
| `_collection`    | `address` | The address of the collection                                        |
| `_eth`           | `uint`    | The amount of ETH-equivalent (native) tokens to commit               |
| `_tokenIds`      | `uint[]`  | An array of NFTs the caller is depositing as liquidity               |
| `_tokenSlippage` | `uint`    | Additional collection-token headroom; any unused portion is refunded |
| `_sqrtPriceX96`  | `uint160` | The initial price of the token position                              |

**Returns:** None.

### `setCollectionTokenMetadata`

Lets the contract owner update a collection token's name and symbol — a safety valve for tokens created with malformed, unintelligible, or offensive metadata.

```solidity
function setCollectionTokenMetadata(address _collection, string calldata _name, string calldata _symbol) external;
```

**Access:** `onlyOwner`, collection must exist.

| Parameter     | Type      | Description                  |
| ------------- | --------- | ---------------------------- |
| `_collection` | `address` | The collection address       |
| `_name`       | `string`  | The new name for the token   |
| `_symbol`     | `string`  | The new symbol for the token |

**Returns:** None.

### `sunsetCollection`

Permanently removes a collection from the platform. This is important during a shutdown so that holders can't keep listing assets into a vault that's being wound down. It's callable only by the [Collection Shutdown](/contracts/collection-shutdown) contract.

```solidity
function sunsetCollection(address _collection) external;
```

**Access:** collection must exist; only callable by the configured `CollectionShutdown` contract. Flags the collection as sunset to block re-registration.

| Parameter     | Type      | Description                   |
| ------------- | --------- | ----------------------------- |
| `_collection` | `address` | The address of the collection |

**Returns:** None.

## Listings registry and views

### `collectionToken`

Returns the deployed `CollectionToken` for a collection (the zero address if the collection has none).

```solidity
function collectionToken(address _collection) external view returns (ICollectionToken);
```

| Parameter     | Type      | Description            |
| ------------- | --------- | ---------------------- |
| `_collection` | `address` | The collection address |

| Return    | Type               | Description                   |
| --------- | ------------------ | ----------------------------- |
| (unnamed) | `ICollectionToken` | The collection's ERC-20 token |

### `isListing`

Checks across every authorised Listings contract whether a given token is currently an active listing.

```solidity
function isListing(address _collection, uint _tokenId) external view returns (bool);
```

| Parameter     | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `_collection` | `address` | The collection address of the listing |
| `_tokenId`    | `uint`    | The tokenId of the listing            |

| Return    | Type   | Description                                          |
| --------- | ------ | ---------------------------------------------------- |
| (unnamed) | `bool` | Whether the listing exists (`true`) or not (`false`) |

### `listingsAt` / `listingsLength`

Enumerate the authorised Listings contracts. `listingsLength` returns the count; `listingsAt` returns the contract at a given index (reverts if out of range).

```solidity
function listingsAt(uint _index) external view returns (IListings);
function listingsLength() external view returns (uint);
```

| Parameter | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| `_index`  | `uint` | The index of the listings contract to retrieve |

| Return      | Type        | Description                                |
| ----------- | ----------- | ------------------------------------------ |
| `IListings` | `IListings` | The listings contract at the given index   |
| `uint`      | `uint`      | The count of registered listings contracts |

### `addListings` / `removeListings`

Register or de-register an authorised Listings contract.

```solidity
function addListings(address _listings_) external;
function removeListings(address _listings_) external;
```

**Access:** `onlyOwner`. `addListings` reverts on the zero address or a duplicate; `removeListings` reverts if the contract isn't registered.

| Parameter    | Type      | Description                                                    |
| ------------ | --------- | -------------------------------------------------------------- |
| `_listings_` | `address` | The address of the Listings contract to register / de-register |

**Returns:** None.

## Manager operations

{% hint style="warning" %}
These functions are callable only by an approved [Locker Manager](/contracts/supporting#lockermanager) and can mint or withdraw without a matching NFT. Managers are trusted to keep the collection token fully backed; misuse can break a collection.
{% endhint %}

### `unbackedDeposit`

Mints underlying collection tokens and hands them to an approved manager, trusting the manager not to break the backing count.

```solidity
function unbackedDeposit(address _collection, uint _amount) external;
```

**Access:** approved managers only, `nonReentrant`, `whenNotPaused`, collection must exist.

| Parameter     | Type      | Description                         |
| ------------- | --------- | ----------------------------------- |
| `_collection` | `address` | The address of the token collection |
| `_amount`     | `uint`    | The amount of ERC-20 tokens to mint |

**Returns:** None.

### `withdrawToken`

Lets an approved manager withdraw an ERC-721 from the Locker.

```solidity
function withdrawToken(address _collection, uint _tokenId, address _recipient) external;
```

**Access:** approved managers only.

| Parameter     | Type      | Description                      |
| ------------- | --------- | -------------------------------- |
| `_collection` | `address` | The collection address           |
| `_tokenId`    | `uint`    | The tokenId to withdraw          |
| `_recipient`  | `address` | The address to receive the token |

**Returns:** None.

## Administration

All of the following are `onlyOwner`.

### `setCollectionShutdownContract`

Sets the `ICollectionShutdown` contract — the only contract permitted to call `sunsetCollection`.

```solidity
function setCollectionShutdownContract(address payable _collectionShutdown) external;
```

| Parameter             | Type              | Description              |
| --------------------- | ----------------- | ------------------------ |
| `_collectionShutdown` | `address payable` | The new contract address |

### `setImplementation`

Sets the `INFTXV4Hook` implementation used by the Locker.

{% hint style="warning" %}
This can only be set **once**, to a non-zero address. It reverts if the implementation is already set.
{% endhint %}

```solidity
function setImplementation(address _implementation) external;
```

| Parameter         | Type      | Description                   |
| ----------------- | --------- | ----------------------------- |
| `_implementation` | `address` | The new `INFTXV4Hook` address |

### Fees, gate, and pausing

```solidity
function setCollectionCreationFee(uint _collectionCreationFee) external;
function setCollectionCreationFeeRecipient(address _collectionCreationFeeRecipient) external;
function setLaunchGate(address _launchGate) external;
function pause(bool _paused) external;
```

| Function                            | Parameter                                     | Description                                                                               |
| ----------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `setCollectionCreationFee`          | `_collectionCreationFee` (`uint`)             | The new collection creation fee, in ETH                                                   |
| `setCollectionCreationFeeRecipient` | `_collectionCreationFeeRecipient` (`address`) | The address that receives the creation fee (reverts on zero address)                      |
| `setLaunchGate`                     | `_launchGate` (`address`)                     | The launch gate to consult; pass `address(0)` to detach it and make launches unrestricted |
| `pause`                             | `_paused` (`bool`)                            | Pause (`true`) or unpause (`false`) all Locker activity                                   |


# Collection Token

The per-collection ERC-20 that represents a collection's floor.

Every collection supported by NFTX v4 gets its own `CollectionToken`, an ERC-20 that is the fungible representation of that ERC-721 collection — the collection's floor token. It's deployed as a minimal-proxy clone per collection, so `initialize` takes the place of a constructor. Minting and burning are owned by the [Locker](/contracts/locker), which keeps supply backed 1:1 by the NFTs it holds.

Signatures and descriptions below come from the `ICollectionToken` interface.

### `initialize`

Sets the initial token metadata, registers inherited contracts, and assigns ownership. Called once, at clone deployment.

```solidity
function initialize(string calldata name_, string calldata symbol_) external;
```

**Access:** `initializer` (callable once).

| Parameter | Type     | Description              |
| --------- | -------- | ------------------------ |
| `name_`   | `string` | The name for the token   |
| `symbol_` | `string` | The symbol for the token |

**Returns:** None.

### `mint`

Mints additional collection tokens. Restricted to the owner (the Locker), which mints on deposit.

```solidity
function mint(address _to, uint _amount) external;
```

**Access:** `onlyOwner`. Reverts if `_to` is the zero address.

| Parameter | Type      | Description                       |
| --------- | --------- | --------------------------------- |
| `_to`     | `address` | The recipient of the minted token |
| `_amount` | `uint`    | The number of tokens to mint      |

**Returns:** None.

### `setMetadata`

Updates the token's name and symbol — a safety valve for malformed, unintelligible, or offensive metadata. Emits `MetadataUpdated`.

```solidity
function setMetadata(string calldata name_, string calldata symbol_) external;
```

**Access:** `onlyOwner`.

| Parameter | Type     | Description                  |
| --------- | -------- | ---------------------------- |
| `name_`   | `string` | The new name for the token   |
| `symbol_` | `string` | The new symbol for the token |

**Returns:** None.

### `burn` / `burnFrom`

Destroys tokens. `burn` burns from the caller; `burnFrom` burns from another account, deducting from the caller's allowance.

```solidity
function burn(uint value) external;
function burnFrom(address account, uint value) external;
```

**Access:** public. `burnFrom` reverts if the caller has insufficient allowance.

| Parameter | Type      | Description                                       |
| --------- | --------- | ------------------------------------------------- |
| `account` | `address` | The account to burn tokens from (`burnFrom` only) |
| `value`   | `uint`    | The amount of tokens to burn                      |

**Returns:** None.

{% hint style="info" %}
Beyond these, `CollectionToken` is a standard ERC-20 (with permit) — `transfer`, `approve`, `balanceOf`, `allowance`, and so on behave as usual.
{% endhint %}


# Listings

The self-assessed listing system — liquid and Dutch listings priced in floor multiples, with tax prepaid on creation.

`Listings` is NFTX v4's self-assessed listing system. A seller lists a non-floor item at a chosen **floor multiple** and duration; the listing accrues **tax upfront** based on that price and duration, priced and paid in the collection's ERC-20. Cancelling or shortening a listing refunds the unused tax pro-rata. Collections can override the defaults for both the [tax calculator](/contracts/tax-calculator) and the listing config.

Signatures and descriptions below come from the `IListings` interface. Two listing shapes exist — **liquid** and **Dutch** — and an expired liquid listing automatically decays through a trailing Dutch phase (see [`getListingType`](#getlistingtype)).

## Data structures

### `Listing`

The stored state of a single listing.

| Field           | Type              | Description                                                                   |
| --------------- | ----------------- | ----------------------------------------------------------------------------- |
| `owner`         | `address payable` | Address that owns and can manage the listing                                  |
| `created`       | `uint40`          | Timestamp of listing creation                                                 |
| `duration`      | `uint32`          | Prepaid duration of the listing, in seconds                                   |
| `floorMultiple` | `uint16`          | Price as a multiple of the floor token, to two decimal places (`100` = 1.00x) |

### `CreateListing`

The input to [`createListings`](#createlistings) and [`relist`](#relist).

| Field        | Type      | Description                                           |
| ------------ | --------- | ----------------------------------------------------- |
| `collection` | `address` | The collection address of the assets being listed     |
| `tokenIds`   | `uint[]`  | The token IDs being listed                            |
| `listing`    | `Listing` | The `Listing` data defining type, duration, and price |

### `ListingConfig`

Per-collection (or default) bounds that constrain what listings are allowed.

| Field                 | Type     | Description                                                                                                                      |
| --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `maxFloorMultiple`    | `uint16` | Inclusive upper bound on `floorMultiple`; two-decimal precision (`100` = 1.00x)                                                  |
| `minLiquidDuration`   | `uint32` | Inclusive lower bound on liquid-listing duration                                                                                 |
| `maxLiquidDuration`   | `uint32` | Inclusive upper bound on liquid-listing duration                                                                                 |
| `minDutchDuration`    | `uint32` | Inclusive lower bound on Dutch-listing duration                                                                                  |
| `maxDutchDuration`    | `uint32` | Inclusive upper bound on Dutch-listing duration; must be strictly less than `minLiquidDuration` so the type can be discriminated |
| `liquidDutchDuration` | `uint32` | Length of the trailing Dutch decay applied to an expired liquid listing                                                          |

### `FillListingsParams`

The input to [`fillListings`](#filllistings).

| Field         | Type       | Description                                                                                                                                                                                                                                                                                                                                                                       |
| ------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collection`  | `address`  | The collection of the tokens being filled                                                                                                                                                                                                                                                                                                                                         |
| `tokenIdsOut` | `uint[][]` | The token IDs being filled, grouped by owner (for gas efficiency)                                                                                                                                                                                                                                                                                                                 |
| `recipient`   | `address`  | The address to receive the NFTs                                                                                                                                                                                                                                                                                                                                                   |
| `maxSpend`    | `uint`     | Hard cap (in collection-token units) on the total buyer spend — the premium routed to owners plus the floor-equivalent burned. Excludes the protocol fill fee (funded from sellers' prepaid tax). A non-zero value protects against front-running: if owners raise prices between simulation and execution, the fill reverts with `FillCostExceedsMaxSpend`. Pass `0` to opt out. |

## Creating and managing listings

### `createListings`

Creates one or more listings. Each token's tax is calculated and prepaid from the caller's funds; the NFTs are held in the Locker and the caller receives one collection token per NFT, minus tax.

```solidity
function createListings(CreateListing[] calldata _createListings) external;
```

**Access:** `nonReentrant`, Locker not paused. Reverts with `InsufficientTax` if the tokens received don't cover the required tax; validates each collection's config bounds; emits `ListingsCreated`.

| Parameter         | Type              | Description                           |
| ----------------- | ----------------- | ------------------------------------- |
| `_createListings` | `CreateListing[]` | Array of listing structures to create |

**Returns:** None.

### `modifyListings`

Changes the duration or price of existing **liquid** listings. Additional tax is required for a longer/higher listing, or tax is refunded for a shorter/lower one; any refund is applied to the new tax first, for gas savings.

```solidity
function modifyListings(address _collection, ModifyListing[] calldata _modifyListings, bool _payTaxWithEscrow) external returns (uint taxRequired_, uint refund_);
```

**Access:** `nonReentrant`, Locker not paused. Caller must be the listing owner; only liquid listings can be modified.

| Parameter           | Type              | Description                                                       |
| ------------------- | ----------------- | ----------------------------------------------------------------- |
| `_collection`       | `address`         | The collection address of the listing                             |
| `_modifyListings`   | `ModifyListing[]` | The listings to modify (per-token `duration` and `floorMultiple`) |
| `_payTaxWithEscrow` | `bool`            | Whether tax should be paid from the caller's escrow balance       |

| Return         | Type   | Description                                           |
| -------------- | ------ | ----------------------------------------------------- |
| `taxRequired_` | `uint` | The collection tokens required to modify the listings |
| `refund_`      | `uint` | The collection tokens refunded to the owner           |

### `cancelListings`

Cancels liquid listings, returning each NFT for one equivalent collection token and refunding any remaining prepaid tax.

```solidity
function cancelListings(address _collection, uint[] calldata _tokenIds, bool _payTaxWithEscrow) external;
```

**Access:** `nonReentrant`, Locker not paused. Caller must be the listing owner; only liquid listings can be cancelled (not Dutch or expired ones).

| Parameter           | Type      | Description                            |
| ------------------- | --------- | -------------------------------------- |
| `_collection`       | `address` | The collection address of the listing  |
| `_tokenIds`         | `uint[]`  | The token IDs to cancel                |
| `_payTaxWithEscrow` | `bool`    | Whether tax should be paid from escrow |

**Returns:** None.

### `relist`

Buys out an existing listing and immediately re-lists that single token with new parameters — the mechanism behind permissionless re-pricing. The caller cannot be the current owner, who is paid any premium as the old listing is filled.

```solidity
function relist(CreateListing calldata _listing, bool _payTaxWithEscrow) external;
```

**Access:** `nonReentrant`, Locker not paused. Accepts a single-token payload only (reverts `RelistAcceptsSingleTokenOnly` otherwise); emits `ListingRelisted`.

| Parameter           | Type            | Description                                         |
| ------------------- | --------------- | --------------------------------------------------- |
| `_listing`          | `CreateListing` | The new listing (must contain exactly one token ID) |
| `_payTaxWithEscrow` | `bool`          | Whether tax should be paid from escrow              |

**Returns:** None.

### `transferOwnership`

Transfers ownership of a listing to another address.

```solidity
function transferOwnership(address _collection, uint _tokenId, address payable _newOwner) external;
```

**Access:** `nonReentrant`, Locker not paused. Caller must be the listing owner; reverts with `NewOwnerIsZero` on the zero address.

| Parameter     | Type              | Description                           |
| ------------- | ----------------- | ------------------------------------- |
| `_collection` | `address`         | The collection address of the listing |
| `_tokenId`    | `uint`            | The tokenId of the listing            |
| `_newOwner`   | `address payable` | The new owner of the listing          |

**Returns:** None.

### `fillListings`

Buys listed NFTs using collection tokens. Token IDs are grouped by owner for gas efficiency. The buyer pays the premium to owners plus the floor-equivalent burned, capped by `maxSpend`; the protocol fill fee comes out of sellers' prepaid tax, not the buyer.

```solidity
function fillListings(FillListingsParams calldata params) external returns (uint totalBurn_);
```

**Access:** `nonReentrant`, Locker not paused. Emits `ListingsFilled`.

| Parameter | Type                 | Description                                                               |
| --------- | -------------------- | ------------------------------------------------------------------------- |
| `params`  | `FillListingsParams` | The fill parameters (collection, grouped token IDs, recipient, max spend) |

| Return       | Type   | Description                                                           |
| ------------ | ------ | --------------------------------------------------------------------- |
| `totalBurn_` | `uint` | The total collection tokens burned (floor equivalent, `1e18` per NFT) |

## Pricing and views

### `getListingPrice`

Returns whether a token can currently be bought from NFTX and its price (in collection-token units, where `1 ether` = 1.0x floor). Dutch listings apply a linear discount over their duration; expired liquid listings enter the trailing Dutch decay.

```solidity
function getListingPrice(address _collection, uint _tokenId) external view returns (bool isAvailable_, uint price_);
```

| Parameter     | Type      | Description                   |
| ------------- | --------- | ----------------------------- |
| `_collection` | `address` | The collection of the listing |
| `_tokenId`    | `uint`    | The token ID of the listing   |

| Return         | Type   | Description                                |
| -------------- | ------ | ------------------------------------------ |
| `isAvailable_` | `bool` | Whether the token is available to purchase |
| `price_`       | `uint` | The price in collection-token terms        |

### `getListingType`

Classifies a listing as `DUTCH`, `LIQUID`, or `NONE`, using the resolved `ListingConfig` for the collection (so per-collection overrides apply here too).

```solidity
function getListingType(address _collection, Listing memory _listing) external view returns (Enums.ListingType);
```

| Parameter     | Type      | Description                   |
| ------------- | --------- | ----------------------------- |
| `_collection` | `address` | The collection of the listing |
| `_listing`    | `Listing` | The listing to classify       |

| Return    | Type                | Description                  |
| --------- | ------------------- | ---------------------------- |
| (unnamed) | `Enums.ListingType` | `DUTCH`, `LIQUID`, or `NONE` |

### `getListingTaxRequired`

Calculates the tax needed to create a listing, validating against a complete `Listing` struct rather than individual parameters. Delegates to the collection's effective [tax calculator](/contracts/tax-calculator).

```solidity
function getListingTaxRequired(Listing memory _listing, address _collection) external view returns (uint taxRequired_);
```

| Parameter     | Type      | Description                      |
| ------------- | --------- | -------------------------------- |
| `_listing`    | `Listing` | The listing to price the tax for |
| `_collection` | `address` | The collection of the listing    |

| Return         | Type   | Description                            |
| -------------- | ------ | -------------------------------------- |
| `taxRequired_` | `uint` | The tax required to create the listing |

### Other views

| Function                                                                | Returns                  | Description                                                         |
| ----------------------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------- |
| `locker()`                                                              | `ILocker`                | The Locker this Listings contract is bound to                       |
| `listings(address _collection, uint _tokenId)`                          | `Listing`                | The stored listing for a token                                      |
| `listingCount(address _collection)`                                     | `uint`                   | Count of open listings for a collection                             |
| `listingConfig(address _collection)`                                    | `ListingConfig`          | The effective config (override if set, else default)                |
| `taxCalculator(address _collection)`                                    | `ITaxCalculator`         | The effective tax calculator (override if set, else default)        |
| `defaultListingConfig()` / `defaultTaxCalculator()`                     | tuple / `ITaxCalculator` | The protocol-wide defaults                                          |
| `collectionListingConfig(address)` / `collectionTaxCalculator(address)` | tuple / `ITaxCalculator` | The raw per-collection override (zero/all-zero means "use default") |

## Configuration (owner only)

These setters are `onlyOwner`.

```solidity
function setDefaultTaxCalculator(address _taxCalculator) external;
function setCollectionTaxCalculator(address _collection, address _taxCalculator) external;
function setDefaultListingConfig(ListingConfig calldata _config) external;
function setCollectionListingConfig(address _collection, ListingConfig calldata _config) external;
```

| Function                     | Parameters                                              | Description                                                                                                                           |
| ---------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `setDefaultTaxCalculator`    | `_taxCalculator` (`address`)                            | Sets the protocol-wide default calculator (reverts on the zero address)                                                               |
| `setCollectionTaxCalculator` | `_collection` (`address`), `_taxCalculator` (`address`) | Sets a per-collection override; pass `address(0)` to clear it and inherit the default                                                 |
| `setDefaultListingConfig`    | `_config` (`ListingConfig`)                             | Sets the default config; validated for cross-field invariants (e.g. `maxDutchDuration < minLiquidDuration`, `maxFloorMultiple > 100`) |
| `setCollectionListingConfig` | `_collection` (`address`), `_config` (`ListingConfig`)  | Sets a per-collection override; pass an all-zero struct (`maxFloorMultiple == 0`) to clear it                                         |


# Tax Calculator

Prices the listing tax from floor multiple and duration, with a softening kink above 2.00x floor.

`TaxCalculator` determines the tax a seller pays to create a listing. The tax is quoted and paid in the collection's ERC-20, prepaid at listing creation, and pro-rata refundable if the listing is later modified or cancelled. It's the mechanism that makes the [self-assessed listing model](/contracts/listings) work: overpricing an item is allowed, but the higher the price and the longer the duration, the more tax you pay.

Signatures and descriptions below come from the `ITaxCalculator` interface.

### `calculateTax`

Calculates the tax required to create a listing from its floor multiple and duration. The function is `pure` and deterministic.

```solidity
function calculateTax(address _collection, uint _floorMultiple, uint _duration) external view returns (uint taxRequired_);
```

| Parameter        | Type      | Description                                                        |
| ---------------- | --------- | ------------------------------------------------------------------ |
| `_collection`    | `address` | The collection address of the listing                              |
| `_floorMultiple` | `uint`    | The floor multiple, to two decimals (`150` = 1.50x, `200` = 2.00x) |
| `_duration`      | `uint`    | The duration of the listing, in seconds                            |

| Return         | Type   | Description                            |
| -------------- | ------ | -------------------------------------- |
| `taxRequired_` | `uint` | The collection tokens required to list |

## The fee curve

Tax scales with the **square of the floor multiple** and **linearly with duration**, normalised to a 7-day reference. Above a kink at floor multiple `200` (2.00x), the curve softens — halving the effective slope — to encourage high-value "grail" listings rather than penalise them.

For `floorMultiple ≤ 200`:

$$
\text{tax} = \text{floorMultiple}^2 \times 10^{12} \times \frac{\text{duration}}{7\ \text{days}}
$$

For `floorMultiple > 200` (the softened branch):

$$
\text{tax} = (\text{floorMultiple} + 200)^2 \times 10^{12} \times \frac{\text{duration}}{4 \times 7\ \text{days}}
$$

Both branches meet exactly at the `FLOOR_MULTIPLE_KINK` of `200`, so the curve is continuous there.

{% hint style="info" %}
`FLOOR_MULTIPLE_KINK = 200` (i.e. 2.00x). Below it, tax grows with the square of the multiple; above it, the softened branch keeps grail listings affordable.
{% endhint %}

## Worked examples

For a **7-day** listing, the tax works out to (in FLOOR / collection-token units, where `1` = one whole token):

| Floor multiple | Tax (7-day listing) |
| -------------- | ------------------- |
| 1.50x          | 0.0225 FLOOR        |
| 2.00x (kink)   | 0.04 FLOOR          |
| 3.00x          | 0.0625 FLOOR        |
| 4.00x          | 0.09 FLOOR          |
| 10.00x         | 0.36 FLOOR          |

Because tax is linear in duration, halving the duration halves the tax, and doubling it doubles the tax. Setting a price far above fair value is possible, but the fee climbs steeply — so a mispriced item simply won't sell, and the prepaid tax bleeds down until the listing closes.


# NFTX V4 Hook

The Uniswap V4 hook — the single integration point for NFTX v4 pool fees and swaps.

`NFTXV4Hook` is the sole Uniswap V4-backed implementation the [Locker](/contracts/locker) talks to. It creates and initialises each collection's pool, resolves the dynamic swap fee, and routes fee revenue — the single place where pool fees and swaps are integrated. Fees are expressed in **Uniswap V4 pip units**, where `1_000_000` equals 100%.

{% hint style="info" %}
Since the [flex pools](/how-it-works/flex-pools) release this is one of two hooks. `NFTXV4Hook` and the [NFTX Flex Hook](/contracts/nftx-flex-hook) share one abstract core, `NFTXHookCore`, for swaps, fees, donations, the oracle and the fee escrow; this contract keeps the Locker-only lifecycle and the collection's canonical flETH pool, and nothing about it changed on-chain.
{% endhint %}

Signatures and descriptions below come from the `INFTXV4Hook` interface and its implementation. Collection registration and initialisation are callable only by the Locker; the fee controls are `onlyOwner`.

## Pool registration and liquidity

### `registerCollection`

Registers a collection with the hook, creating its pool key and storing its pool parameters.

```solidity
function registerCollection(address _collection, ICollectionToken _collectionToken) external;
```

**Access:** Locker only (reverts `CallerIsNotLocker` otherwise).

| Parameter          | Type               | Description                                    |
| ------------------ | ------------------ | ---------------------------------------------- |
| `_collection`      | `address`          | The address of the collection being registered |
| `_collectionToken` | `ICollectionToken` | The underlying ERC-20 token for the collection |

**Returns:** None.

### `initializeCollection`

Creates the collection's pool and its initial liquidity position via the canonical V4 `PositionManager`. Funding both sides mints a full-range position; supplying zero native mints a token-only, single-sided position.

```solidity
function initializeCollection(address _collection, uint _eth, uint _tokens, uint _amount1Slippage, uint160 _sqrtPriceX96, address _recipient) external;
```

**Access:** Locker only.

| Parameter          | Type      | Description                                                  |
| ------------------ | --------- | ------------------------------------------------------------ |
| `_collection`      | `address` | The address of the collection being initialized              |
| `_eth`             | `uint`    | The amount of ETH-equivalent tokens being passed in          |
| `_tokens`          | `uint`    | The number of underlying tokens being supplied               |
| `_amount1Slippage` | `uint`    | The slippage allowed in the underlying token                 |
| `_sqrtPriceX96`    | `uint160` | The initial pool price                                       |
| `_recipient`       | `address` | The recipient of the LP NFT minted by the V4 PositionManager |

**Returns:** None.

### `depositFees`

Queues donation fees for a collection's pool, ready to be donated on the next hook call.

{% hint style="warning" %}
`_amount0` / `_amount1` are denominated in the pool's **V4-sorted** currency order (`currency0 < currency1` by address), **not** "native vs collection". Callers must resolve the active orientation and pass each fee in the matching slot — passing the collection-token fee in the wrong slot reverts, because the matching ERC-20 won't be approved against the implementation.
{% endhint %}

```solidity
function depositFees(address _collection, uint _amount0, uint _amount1) external;
```

| Parameter     | Type      | Description                                    |
| ------------- | --------- | ---------------------------------------------- |
| `_collection` | `address` | The address of the collection                  |
| `_amount0`    | `uint`    | Fees denominated in `currency0` (post-V4 sort) |
| `_amount1`    | `uint`    | Fees denominated in `currency1` (post-V4 sort) |

**Returns:** None.

## Fee resolution (views)

### `getFee`

Resolves the dynamic fee for a pool for a swap initiated by `_origin` (applying any per-origin exemption).

```solidity
function getFee(PoolId _poolId, address _origin) external view returns (uint24 fee_);
```

| Parameter | Type      | Description                               |
| --------- | --------- | ----------------------------------------- |
| `_poolId` | `PoolId`  | The id of the pool                        |
| `_origin` | `address` | The origin of the swap (e.g. `tx.origin`) |

| Return | Type     | Description                      |
| ------ | -------- | -------------------------------- |
| `fee_` | `uint24` | The dynamic fee, in V4 pip units |

### `getCollectionFee`

The effective base LP fee for a collection's pool, ignoring per-origin swap exemptions. [Listings](/contracts/listings) uses this to split listing-tax fees between LPs and the protocol in the same ratio as swap fees.

```solidity
function getCollectionFee(address _collection) external view returns (uint24 fee_);
```

| Parameter     | Type      | Description                              |
| ------------- | --------- | ---------------------------------------- |
| `_collection` | `address` | The collection whose pool fee to resolve |

| Return | Type     | Description                        |
| ------ | -------- | ---------------------------------- |
| `fee_` | `uint24` | The pool's LP fee, in V4 pip units |

### `getCollectionPoolKey` / `poolParams` / `getHookPermissions`

| Function                                    | Returns             | Description                                                                                                                                          |
| ------------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getCollectionPoolKey(address _collection)` | `bytes`             | The encoded `PoolKey` for the collection                                                                                                             |
| `poolParams(PoolId _poolId)`                | `PoolParams`        | The on-chain pool parameters for a pool                                                                                                              |
| `getHookPermissions()`                      | `Hooks.Permissions` | The hook's enabled callbacks — `beforeAddLiquidity`, `afterAddLiquidity`, `beforeRemoveLiquidity`, `afterRemoveLiquidity`, `beforeSwap`, `afterSwap` |

## Fee configuration (owner only)

All of the following are `onlyOwner`.

```solidity
function setFeeExemption(address _beneficiary, uint24 _flatFee) external;
function removeFeeExemption(address _beneficiary) external;
function setDefaultFee(uint24 _defaultFee) external;
function setFee(PoolId _poolId, uint24 _fee) external;
function setAmmFee(uint24 _ammFee) external;
function setAmmBeneficiary(address _ammBeneficiary) external;
```

| Function             | Parameters                                        | Description                                                                                               |
| -------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `setFeeExemption`    | `_beneficiary` (`address`), `_flatFee` (`uint24`) | Sets a flat-fee override for a beneficiary (reverts `FeeExemptionInvalid` if above the V4 max LP fee)     |
| `removeFeeExemption` | `_beneficiary` (`address`)                        | Removes a beneficiary's flat-fee override (reverts `NoBeneficiaryExemption` if none)                      |
| `setDefaultFee`      | `_defaultFee` (`uint24`)                          | Sets the protocol-wide default LP fee                                                                     |
| `setFee`             | `_poolId` (`PoolId`), `_fee` (`uint24`)           | Sets a per-pool LP fee override                                                                           |
| `setAmmFee`          | `_ammFee` (`uint24`)                              | Sets the AMM fee taken from the unspecified leg of every swap, credited to the AMM beneficiary via escrow |
| `setAmmBeneficiary`  | `_ammBeneficiary` (`address`)                     | Sets the address that receives AMM fees                                                                   |


# NFTX Flex Hook

The second Uniswap V4 hook — permissionless pools pairing a collection token with any whitelisted pair token, sharing the canonical hook's fee logic.

`NFTXFlexHook` runs the [flex pools](/how-it-works/flex-pools): Uniswap V4 pools that pair a collection token registered on the [Locker](/contracts/locker) with a pair token the [pair-token whitelist](#pair-token-whitelist) accepts. It is a separate deployment beside the canonical [NFTX V4 Hook](/contracts/nftx-v4-hook), which is unchanged: the Locker still creates every collection's flETH pool through the canonical hook, and every existing pool key, position and fee balance stays where it is.

Both hooks are thin subclasses of one abstract core, `NFTXHookCore`, which holds the swap, fee, donation, oracle and escrow logic they share. The flex hook adds permissionless initialisation, the whitelist pointer, a pause switch, a `deregisterPool` control and native-ETH settlement; it has none of the canonical hook's Locker-only lifecycle functions (`registerCollection`, `initializeCollection`, `depositFees`, `getCollectionPoolKey`, `getCollectionFee`). Fees are in **Uniswap V4 pip units**, where `1_000_000` equals 100%.

Signatures below come from `INFTXFlexHook`, which extends `INFTXHookCore`. Every flex event is keyed by `PoolId`, because a flex pool is not one-per-collection.

## Pool initialisation

There is no function to call on the hook. A flex pool is created by `PoolManager.initialize(key, sqrtPriceX96)` with a `PoolKey` whose `hooks` is this contract; the hook's `beforeInitialize` callback admits or refuses it. Checks run in this order, each with its own error:

| #  | Rule                                                    | Error                                                               |
| -- | ------------------------------------------------------- | ------------------------------------------------------------------- |
| 1  | Pool creation is not paused                             | `PoolCreationPaused()`                                              |
| 2  | `key.fee` is the dynamic-fee flag (`0x800000`)          | `StaticFeeNotSupported(uint24 _fee)`                                |
| 3  | `key.tickSpacing` is 10, 60 or 200                      | `TickSpacingNotAllowed(int24 _tickSpacing)`                         |
| 4a | At least one currency passes `Locker.isCollectionToken` | `NoCollectionToken(address _currency0, address _currency1)`         |
| 4b | Not both currencies do                                  | `BothSidesCollectionTokens(address _currency0, address _currency1)` |
| 5  | Neither currency is the canonical pair token (flETH)    | `CanonicalPairTokenNotAllowed()`                                    |
| 6  | The pool id was not previously deregistered             | `PoolDeregistered()`                                                |
| 7  | The whitelist allows `(collectionToken, pairToken)`     | `PairTokenNotAllowed(address _pairToken)`                           |

Native ETH is `address(0)`, which never passes `isCollectionToken`, so a native pool always has the collection token as `currency1`. Whether `address(0)` is an acceptable pair is the whitelist's decision, not the hook's; a revert inside the whitelist bubbles up and simply fails that initialisation.

On success the hook stores the pool's parameters (`poolParams(poolId).collection` is the **collection token** address here — on the canonical hook the same field holds the ERC-721 collection), seeds the price oracle at the initial tick, and emits `FlexPoolInitialized`. No state event is emitted at this point because `slot0` is not written yet; the first liquidity add emits the first `FlexPoolStateUpdated`.

{% hint style="warning" %}
`PositionManager.initializePool` swallows hook reverts and returns `type(int24).max`, so a refused key looks like a success to a script that only checks the call. Either call `PoolManager.initialize` directly, or read `poolParams(poolId).initialized` afterwards.
{% endhint %}

## Views

| Function                                         | Returns                         | Description                                                                                                              |
| ------------------------------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `nativeToken()`                                  | `address`                       | The canonical pair token (flETH). Pools against it are rejected here                                                     |
| `pairTokenWhitelist()`                           | `IPairTokenWhitelist`           | The policy consulted at initialisation                                                                                   |
| `paused()`                                       | `bool`                          | Whether new pool creation is paused. Existing pools keep trading                                                         |
| `isAllowedTickSpacing(int24)`                    | `bool`                          | `true` for 10, 60 and 200                                                                                                |
| `locker()`                                       | `ILocker`                       | The Locker whose `isCollectionToken` gates admission                                                                     |
| `poolParams(PoolId)`                             | `PoolParams`                    | Recorded parameters: `collection` (the collection token), `initialized`, `currencyFlipped`, `deregistered`, per-pool fee |
| `getFee(PoolId, address _origin)`                | `uint24`                        | The dynamic LP fee for a swap from `_origin`, applying any exemption                                                     |
| `defaultFee()` / `ammFee()` / `ammBeneficiary()` | `uint24` / `uint24` / `address` | The fee settings shared with the canonical hook's model                                                                  |
| `getHookPermissions()`                           | `Hooks.Permissions`             | The same eight callbacks as the canonical hook                                                                           |

## Admin (owner only)

```solidity
function setPairTokenWhitelist(IPairTokenWhitelist _whitelist) external;
function setPaused(bool _paused) external;
function deregisterPool(PoolId _poolId) external;
```

| Function                | Description                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setPairTokenWhitelist` | Points the hook at a new whitelist. Takes effect for the **next** initialisation; existing pools are never closed by a policy change. Reverts `ZeroAddress()` for the zero address. Emits `PairTokenWhitelistSet`                                                                                                                                                                                                |
| `setPaused`             | Pauses or resumes new pool creation. Emits `PausedSet`                                                                                                                                                                                                                                                                                                                                                           |
| `deregisterPool`        | Retires a pool. The Locker's sunset never clears `isCollectionToken`, so a wound-down collection's flex pools would otherwise keep quoting an unredeemable token. After this, swaps revert `PoolDeregistered()`, liquidity callbacks stay open so LPs can exit, and the key can never be re-admitted. Terminal. Reverts `PoolNotInitialized()` for a pool this hook never admitted. Emits `FlexPoolDeregistered` |

The fee controls inherited from the shared core — `setDefaultFee`, `setFee` (per pool), `setAmmFee`, `setAmmBeneficiary`, `setFeeExemption`, `removeFeeExemption`, `setNotifier` — are documented on the [NFTX V4 Hook](/contracts/nftx-v4-hook#fee-configuration-owner-only) page and behave the same here. Fee exemptions are per hook: an exemption granted on the canonical hook does not apply to flex pools unless it is set here too.

## Fees and native ETH

The AMM fee is taken from the unspecified leg of every swap, in whatever currency that leg is in, and credited to the AMM beneficiary through the hook's built-in token escrow, where the beneficiary withdraws it. Two things differ from the canonical hook:

* **The escrow credit is measured, not assumed.** The flex hook credits the balance the swap actually delivered, capped at the nominal fee, so a pair token that charges a transfer fee or rebases cannot leave the escrow short. A pair token that blocklists the hook makes that pool's swaps revert and touches no other pool.
* **Native ETH settles.** The hook has a `receive()` function so the `PoolManager` can deliver an ETH fee, which the escrow tracks as `address(0)`. Stray ETH sent to the hook is unaccounted and cannot be drained; the same is true of stray ERC-20s on either hook.

Flex pools have no `depositFees`, so the listing-tax donations that [Listings](/contracts/listings) routes into canonical pools never reach them.

## Events

Flex-specific, all keyed by `PoolId`:

```solidity
event FlexPoolInitialized(PoolId indexed _poolId, address indexed _collectionToken, address indexed _pairToken, PoolKey _key, uint160 _sqrtPriceX96);
event FlexPoolStateUpdated(PoolId indexed _poolId, uint160 _sqrtPriceX96, int24 _tick, uint24 _protocolFee, uint24 _swapFee, uint128 _liquidity);
event FlexPoolFeeSet(PoolId indexed _poolId, uint24 _fee);
event FlexPoolFeesDonated(PoolId indexed _poolId, uint _amount0, uint _amount1); // unreachable in v1: no depositFees
event FlexAMMFeesTaken(PoolId indexed _poolId, address _recipient, address _token, uint _amount);
event FlexPoolDeregistered(PoolId indexed _poolId);
event PausedSet(bool _paused);
event PairTokenWhitelistSet(address _whitelist);
```

Shared with the canonical hook through `INFTXHookCore`: `DefaultFeeSet`, `AMMFeeSet`, `AMMBeneficiarySet`, `FeeOverrideSet`, `FeeOverrideRemoved`, `NotifierSet`.

## Pair-token whitelist

`IPairTokenWhitelist` is a one-function policy contract the hook consults once, at initialisation:

```solidity
function isPairTokenAllowed(address _collectionToken, address _pairToken) external view returns (bool);
```

Both sides are passed so a later version can whitelist per collection without an interface change. Native ETH is `address(0)`.

The first implementation, `OpenPairTokenWhitelist`, is stateless and ownerless and returns `true` for every pair, `address(0)` included. Policy changes are a new whitelist deployment adopted through `setPairTokenWhitelist`, never an edit to the deployed one. Because the whitelist is only consulted at initialisation, delisting a pair token later stops **new** pools with it and never closes an existing one.

## Deployment

The flex hook and the whitelist are deployed through CreateX's CREATE3 from the protocol deployer under the `nftx.v3` salt namespace, so — like every other protocol contract — they will carry the same address on each chain they reach. The hook's salt is mined so its address carries the eight hook-permission flags.

| Field                    | Value                                                                                  |
| ------------------------ | -------------------------------------------------------------------------------------- |
| `NFTXFlexHook`           | `0xC26A5Cb51b1818F62a4C6693a9a1feDB3340efc4`                                           |
| `OpenPairTokenWhitelist` | `0x0A97DDb5d5B96ed0E9E014ced7bC7AD20b8Df494`                                           |
| `NFTXFlexHook` salt      | `0xb8a70b4d1547bf6193bd67a73f4f98ea9fd0a97300d5058ee1744140af470ce5` (iteration 14037) |

Ethereum Mainnet is live (block `25933487`, 2026-09-08) with the canonical hook's fee settings copied at deployment — default LP fee `9000` (0.9%), AMM fee `1000` (0.1%), AMM beneficiary the `ProtocolFeeReceiver` — and the open whitelist attached. Ownership sits with the protocol's Labs multisig, as it does for the Locker and the canonical hook. The full per-chain list is on [Deployment Addresses](/contracts/addresses).

Base Sepolia is excluded: its earlier-generation Locker has no `isCollectionToken`, which the flex hook needs. Base Mainnet was redeployed onto the current generation on 18 September 2026 and its Locker does have it, so nothing rules the flex hook out there — it has simply not been deployed to Base yet.


# Zap

Atomic ETH ↔ NFT and ETH ↔ collection-token flows in a single call.

`NFTXZap` bundles ETH wrapping, Uniswap V4 swaps, and Locker/Listings interactions into single transactions — so a user can go straight from ETH to an NFT (or back) without juggling intermediate steps. It uses delta-based accounting and reentrancy guards to prevent donation-stealing.

Signatures and descriptions below come from the `INFTXZap` interface. Every entry point is `nonReentrant`; the ETH-in flows are `payable`.

### `buyNFTWithETH`

Buys listed NFTs with ETH in one transaction. Flow: `ETH → flETH.deposit() → swap flETH → collection token → listings.fillListings() → NFT to user`.

```solidity
function buyNFTWithETH(address _collection, uint[][] calldata _tokenIdsOut, uint _minTokensReceived, uint _maxETHSpent) external payable returns (uint ethSpent_);
```

| Parameter            | Type       | Description                                                                                                                                                                                                            |
| -------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_collection`        | `address`  | The NFT collection address                                                                                                                                                                                             |
| `_tokenIdsOut`       | `uint[][]` | Token IDs to buy, grouped by listing owner (gas optimization)                                                                                                                                                          |
| `_minTokensReceived` | `uint`     | Minimum tokens from the initial ETH→token swap (slippage protection); set from expected swap output, not listing cost                                                                                                  |
| `_maxETHSpent`       | `uint`     | Hard cap on realised ETH spend; reverts `ExcessiveInput` above it. Pass `msg.value` to opt out. Combined with `FillListingsParams.maxSpend`, protects against sandwich griefing via upward `modifyListings` front-runs |

| Return      | Type   | Description                  |
| ----------- | ------ | ---------------------------- |
| `ethSpent_` | `uint` | The ETH spent, after refunds |

### `sellNFTForETH`

Sells floor NFTs for ETH in one transaction. Flow: `NFT → locker.deposit() → swap collection token → flETH → flETH.withdraw() → ETH to user`.

For an ERC721-C collection that enforces royalties on NFTX, the deposit leg is refused; sell through the [Royalty Gate](/contracts/royalty-gate)'s `sellNFTsForETH` instead.

```solidity
function sellNFTForETH(address _collection, uint[] calldata _tokenIds, uint _minETHReceived) external returns (uint ethReceived_);
```

| Parameter         | Type      | Description                                  |
| ----------------- | --------- | -------------------------------------------- |
| `_collection`     | `address` | The NFT collection address                   |
| `_tokenIds`       | `uint[]`  | Token IDs to sell                            |
| `_minETHReceived` | `uint`    | Minimum ETH to receive (slippage protection) |

| Return         | Type   | Description      |
| -------------- | ------ | ---------------- |
| `ethReceived_` | `uint` | The ETH received |

### `redeemFloorWithETH`

Redeems specific floor NFTs by buying the tokens with ETH and redeeming them. Flow: `ETH → swap → collection token → locker.redeem(tokenIds) → NFTs to user`.

```solidity
function redeemFloorWithETH(address _collection, uint[] calldata _tokenIds, uint _maxETHSpent) external payable returns (uint ethSpent_);
```

| Parameter      | Type      | Description                                  |
| -------------- | --------- | -------------------------------------------- |
| `_collection`  | `address` | The NFT collection address                   |
| `_tokenIds`    | `uint[]`  | Specific token IDs to redeem from the Locker |
| `_maxETHSpent` | `uint`    | Maximum ETH to spend (slippage protection)   |

| Return      | Type   | Description   |
| ----------- | ------ | ------------- |
| `ethSpent_` | `uint` | The ETH spent |

### Token swaps

Convenience swaps between ETH and a collection token, without touching NFTs.

```solidity
function buyTokensWithETH(address _collection, uint _minTokensReceived) external payable returns (uint tokensReceived_);
function sellTokensForETH(address _collection, uint _tokenAmount, uint _minETHReceived) external returns (uint ethReceived_);
function sellTokensForETHWithPermit2(address _collection, uint _tokenAmount, uint _minETHReceived, uint _deadline, uint _nonce, bytes calldata _signature) external returns (uint ethReceived_);
```

| Function                      | Key parameters                                             | Returns                                                                                         |
| ----------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `buyTokensWithETH`            | `_collection`, `_minTokensReceived`                        | `tokensReceived_` — collection tokens received                                                  |
| `sellTokensForETH`            | `_collection`, `_tokenAmount`, `_minETHReceived`           | `ethReceived_` — ETH received                                                                   |
| `sellTokensForETHWithPermit2` | as above, plus Permit2 `_deadline`, `_nonce`, `_signature` | `ethReceived_` — ETH received, pulling tokens via a Permit2 signature (no separate approval tx) |


# Migrator Zap

Atomic NFTX v2/v3 → v4 migration — redeem whole NFTs from a legacy vault and mint v4 floor tokens in one call — plus an owner-settled dust escrow for sub-unit legacy balances.

`MigratorZap` moves holders of legacy NFTX vault tokens into v4. A migration call redeems the named NFTs from a v2 or v3 vault, deposits them into the v4 `Locker`, and mints the collection token straight to the recipient — one transaction, whole units only (`N * 1e18` vault tokens for `N` NFTs). For balances below one whole unit it carries a **dust escrow**: the owner registers legacy → replacement token pairs, holders escrow their dust, and the owner settles batches at exactly 1:1.

Ethereum Mainnet only — the legacy v2/v3 factories were never deployed elsewhere. Every state-changing entry point is `nonReentrant`; `migrateFromV3` is `payable`. NFTs land on the contract only between redeem and deposit within a single transaction; beyond escrowed dust and pre-funded replacement tokens, nothing settles here.

Signatures, events and errors below come from the `IMigratorZap` interface, which integrators should build against.

{% hint style="info" %}
Legacy vaults key their fee exclusion off `msg.sender`, so excluding this one router (a legacy-factory-owner action) waives redeem fees for everyone who migrates through it. Until then, quotes include the fee.
{% endhint %}

## Migration

### `migrateFromV2`

Redeems named NFTs from a v2 vault and mints v4 collection tokens. Flow: `vault tokens → v2 redeemTo → NFTs → locker.deposit() → collection tokens to recipient`.

```solidity
function migrateFromV2(uint vaultId, uint[] calldata tokenIds, address recipient, uint maxVTokenIn) external returns (uint vTokenSpent);
```

| Parameter     | Type      | Description                                                   |
| ------------- | --------- | ------------------------------------------------------------- |
| `vaultId`     | `uint`    | Legacy v2 vault ID                                            |
| `tokenIds`    | `uint[]`  | Exact IDs to withdraw (must be held by the vault)             |
| `recipient`   | `address` | Who receives the minted collection tokens                     |
| `maxVTokenIn` | `uint`    | Ceiling on vault tokens spent — pass `quoteV2`'s first return |

| Return        | Type   | Description                                                            |
| ------------- | ------ | ---------------------------------------------------------------------- |
| `vTokenSpent` | `uint` | Vault tokens pulled from the caller (principal plus any v2 redeem fee) |

### `migrateFromV3`

As above against a v3 vault, where the redeem fee and item premiums are paid in ETH. Send at least `quoteV3Eth`'s `ethRequired`; unused ETH is refunded in the same transaction.

```solidity
function migrateFromV3(uint vaultId, uint[] calldata tokenIds, address recipient, uint premiumLimit) external payable returns (uint ethSpent);
```

| Parameter      | Type      | Description                                                                                             |
| -------------- | --------- | ------------------------------------------------------------------------------------------------------- |
| `vaultId`      | `uint`    | Legacy v3 vault ID                                                                                      |
| `tokenIds`     | `uint[]`  | Exact IDs to withdraw                                                                                   |
| `recipient`    | `address` | Who receives the minted collection tokens                                                               |
| `premiumLimit` | `uint`    | Cap on premium vTokens charged by the vault; pass `0` to derive it from the live quote plus a 5% buffer |

| Return     | Type   | Description                             |
| ---------- | ------ | --------------------------------------- |
| `ethSpent` | `uint` | ETH consumed by the vault after refunds |

### Quotes

```solidity
function quoteV2(uint vaultId, uint count) external view returns (uint vTokenIn, uint feePortion);
function quoteV3VToken(uint count) external pure returns (uint);
function quoteV3Eth(uint vaultId, uint[] calldata tokenIds) external view returns (uint ethRequired, uint premiumVToken);
function isFeeExemptV2() external view returns (bool);
function isFeeExemptV3() external view returns (bool);
```

| Function                          | Returns                                                                                                                                                                                            |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quoteV2`                         | Vault tokens needed to redeem `count` NFTs, and the fee portion inside that figure (`0` when fee-excluded)                                                                                         |
| `quoteV3VToken`                   | Vault tokens burned by a v3 redeem — always `count * 1e18`                                                                                                                                         |
| `quoteV3Eth`                      | ETH required for the v3 fee + premium on the exact `tokenIds`, and the premium expressed in vTokens. Premiums are priced whether or not the fee is waived; the vault refunds what it does not take |
| `isFeeExemptV2` / `isFeeExemptV3` | Whether the legacy factory currently fee-excludes this router                                                                                                                                      |

## Dust escrow

Sub-unit legacy balances can never redeem an NFT. The escrow retires them: deposits are only accepted for owner-registered pairs, settlement pays the deposited raw amount straight across (both sides of every pair are 18-decimal), and until settlement the depositor can always exit.

### `setDustSwapTokens`

Owner-only. Registers legacy → replacement pairs in one batch; a zero `newToken` unregisters that pair (no new deposits, no settlement — withdrawal keeps working). A registered pair is exactly one whose replacement is non-zero.

```solidity
function setDustSwapTokens(address[] calldata legacyTokens, address[] calldata newTokens) external;
```

| Parameter      | Type        | Description                                           |
| -------------- | ----------- | ----------------------------------------------------- |
| `legacyTokens` | `address[]` | The tokens being retired                              |
| `newTokens`    | `address[]` | Their replacements, index-aligned; zero to unregister |

### `depositDust`

Escrows legacy dust against a later owner settlement. The amount credited is the balance the contract actually received. Closed while the zap is paused.

```solidity
function depositDust(address legacyToken, uint amount) external returns (uint depositId);
```

| Parameter     | Type      | Description                        |
| ------------- | --------- | ---------------------------------- |
| `legacyToken` | `address` | A registered legacy token          |
| `amount`      | `uint`    | Raw amount to pull from the caller |

| Return      | Type   | Description                                     |
| ----------- | ------ | ----------------------------------------------- |
| `depositId` | `uint` | Handle for `withdrawDust` / `finaliseDustSwaps` |

### `withdrawDust`

Reclaims an escrowed deposit that has not been settled. Depositor-only, and deliberately not gated on pause or the pair still being registered — once escrowed, the exit is always open.

```solidity
function withdrawDust(uint depositId) external;
```

### `finaliseDustSwaps`

Owner-only. Settles a batch of deposits: pays each depositor the deposited amount in the replacement token (from the contract's pre-funded balance) and forwards the legacy tokens to `legacyRecipient`. All-or-nothing — an unknown ID, an unregistered pair, or an underfunded payout reverts the whole batch. Each settled deposit is closed and cannot be withdrawn or settled again.

```solidity
function finaliseDustSwaps(uint[] calldata depositIds, address legacyRecipient) external;
```

| Parameter         | Type      | Description                                            |
| ----------------- | --------- | ------------------------------------------------------ |
| `depositIds`      | `uint[]`  | The deposits to settle (need not share a legacy token) |
| `legacyRecipient` | `address` | Where the escrowed legacy tokens are sent              |

## Administration

```solidity
function setPaused(bool _paused) external;
function sweep(address token, address recipient, uint amount) external;
```

| Function    | Description                                                                                                                                                      |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `setPaused` | Owner-only. Closes the migrate and deposit entry points; withdrawal and settlement stay open                                                                     |
| `sweep`     | Owner-only. Recovers tokens mistakenly sent to the contract. Escrowed dust is excluded from the sweepable balance — depositors' withdraw rights outrank recovery |

## Events

```solidity
event MigratedFromV2(address indexed caller, address indexed vault, address indexed collection, address recipient, uint[] tokenIds, uint vTokenSpent, uint feePaid);
event MigratedFromV3(address indexed caller, address indexed vault, address indexed collection, address recipient, uint[] tokenIds, uint vTokenSpent, uint ethSpent);
event DustSwapTokenSet(address indexed legacyToken, address indexed newToken);
event DustDeposited(uint indexed depositId, address indexed depositor, address indexed legacyToken, uint amount);
event DustWithdrawn(uint indexed depositId, address indexed depositor, address indexed legacyToken, uint amount);
event DustSwapFinalised(uint indexed depositId, address indexed depositor, address indexed legacyToken, address newToken, address legacyRecipient, uint amount);
event PausedSet(bool paused);
event Swept(address indexed token, address indexed recipient, uint amount);
```

## Errors

| Error                                       | Raised when                                                                                     |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `ZapPaused`                                 | A migrate or deposit call arrives while paused                                                  |
| `NoTokenIdsGiven` / `NoDepositsGiven`       | An empty batch is passed                                                                        |
| `UnknownVault(vaultId)`                     | The legacy factory has no vault at that ID                                                      |
| `TargetRedeemDisabled(vault)`               | The v2 vault has targeted redeems switched off                                                  |
| `CostExceedsMaximum(required, maxVTokenIn)` | The v2 quote exceeds the caller's ceiling                                                       |
| `InsufficientEth(required, supplied)`       | `migrateFromV3` was sent less than the quote                                                    |
| `CollectionNotRegistered(collection)`       | The collection has no v4 vault yet                                                              |
| `InvalidToken` / `TokenPairLengthMismatch`  | A degenerate pair (zero legacy, self-mapping) or mismatched batch arrays in `setDustSwapTokens` |
| `DustSwapNotConfigured(legacyToken)`        | A deposit or settlement references an unregistered pair                                         |
| `ZeroAmount`                                | A deposit of zero, or one where nothing arrived                                                 |
| `UnknownDeposit(depositId)`                 | The deposit was never opened, or was already withdrawn or settled                               |
| `NotDepositor(depositId, depositor)`        | A withdrawal from anyone but the depositor                                                      |
| `AmountExceedsFreeBalance(requested, free)` | A sweep that would touch escrowed dust                                                          |
| `InvalidRecipient` / `RefundFailed`         | A zero recipient, or a failed ETH refund                                                        |


# Collection Shutdown

A community-driven wind-down path for illiquid collections, liquidating NFTs via a Sudoswap auction.

When a collection has become illiquid — dust-sized token balances spread across many holders — `CollectionShutdown` lets holders vote to liquidate the remaining NFTs through a Sudoswap auction and claim their pro-rata share of the ETH proceeds. It's the graceful exit for a collection that can no longer sustain a market.

The lifecycle is: **start** a shutdown → holders **vote** → once quorum is reached, the owner **executes** the liquidation → holders **claim** their share. Signatures and descriptions below come from the `ICollectionShutdown` interface.

## Voting lifecycle

### `start`

Triggers a shutdown. Validates that the collection is eligible, emits an event so the frontend can flag it as liquidating, and casts the caller's first vote. Quorum must be reached within a set duration or the process must restart.

```solidity
function start(address _collection) external;
```

**Access:** `nonReentrant`, `whenNotPaused`.

| Parameter     | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `_collection` | `address` | The collection to start shutting down |

**Returns:** None.

### `vote`

Adds the caller's vote to an active shutdown, weighted by their token balance.

```solidity
function vote(address _collection) external;
```

**Access:** `nonReentrant`, `whenNotPaused`. Reverts `ShutdownProccessNotStarted` if none is active. A holder with zero balance is removed from the vote, which prevents vote-transfer-vote replay.

| Parameter     | Type      | Description               |
| ------------- | --------- | ------------------------- |
| `_collection` | `address` | The collection to vote on |

**Returns:** None.

### `reclaimVote`

Retracts the caller's vote and returns their token, as long as quorum hasn't already been reached.

```solidity
function reclaimVote(address _collection) external;
```

**Access:** `whenNotPaused`. Reverts if quorum has passed or the caller hasn't voted.

| Parameter     | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `_collection` | `address` | The collection to reclaim a vote from |

**Returns:** None.

## Execution and claims

### `execute`

Once voting has reached quorum, sends the collection's Locker-held NFTs to a Sudoswap liquidation pool (a declining-price auction) and sunsets the collection.

```solidity
function execute(address _collection, uint[] calldata _tokenIds) external;
```

**Access:** `onlyOwner`, `whenNotPaused`. Reverts if quorum hasn't been reached, no token IDs are supplied, or active listings exist.

| Parameter     | Type      | Description                          |
| ------------- | --------- | ------------------------------------ |
| `_collection` | `address` | The collection address               |
| `_tokenIds`   | `uint[]`  | The token IDs to send to liquidation |

**Returns:** None.

### `claim`

Claims a holder's pro-rata share of the liquidated ETH proceeds, burning their tokens. Requires the liquidation to be complete.

```solidity
function claim(address _collection, address payable _claimant) external;
```

**Access:** `nonReentrant`, `whenNotPaused`. Reverts if the claimant has no claimable votes, the sweeper pool isn't set, or the NFTs haven't all sold.

| Parameter     | Type              | Description                                  |
| ------------- | ----------------- | -------------------------------------------- |
| `_collection` | `address`         | The collection address                       |
| `_claimant`   | `address payable` | The address claiming their liquidation share |

**Returns:** None.

### `voteAndClaim`

A gas-efficient combined path for holders who missed the voting window — votes and claims in one call.

```solidity
function voteAndClaim(address _collection) external;
```

**Access:** `whenNotPaused`. Reverts if the sweeper pool isn't set or the NFTs haven't all sold.

| Parameter     | Type      | Description            |
| ------------- | --------- | ---------------------- |
| `_collection` | `address` | The collection address |

**Returns:** None.

## Safeguards and views

### `cancel`

Cancels a shutdown that hasn't executed once the collection's total supply has risen back above the threshold — preventing a collection flagged in its infancy from being executed later, which would rug holders who joined in between.

```solidity
function cancel(address _collection) external;
```

**Access:** `whenNotPaused`. Reverts if quorum has been reached or supply is still at/below `MAX_SHUTDOWN_TOKENS`.

| Parameter     | Type      | Description            |
| ------------- | --------- | ---------------------- |
| `_collection` | `address` | The collection address |

**Returns:** None.

### `preventShutdown`

Lets an approved [Locker Manager](/contracts/supporting#lockermanager) flag a collection so it can't be shut down. Can't run while a shutdown is already in progress.

```solidity
function preventShutdown(address _collection, bool _prevent) external;
```

**Access:** Locker managers only.

| Parameter     | Type      | Description                                     |
| ------------- | --------- | ----------------------------------------------- |
| `_collection` | `address` | The collection being flagged                    |
| `_prevent`    | `bool`    | `true` to prevent shutdown, `false` to allow it |

**Returns:** None.

### `collectionLiquidationComplete` / `pause`

```solidity
function collectionLiquidationComplete(address _collection) external view returns (bool);
function pause(bool _paused) external;
```

| Function                        | Parameter                 | Description                                                                               |
| ------------------------------- | ------------------------- | ----------------------------------------------------------------------------------------- |
| `collectionLiquidationComplete` | `_collection` (`address`) | Returns `true` if every NFT assigned to the shutdown has been sold from the Sudoswap pool |
| `pause`                         | `_paused` (`bool`)        | `onlyOwner` — pause (`true`) or unpause (`false`) shutdown activity                       |


# Supporting Contracts

The Locker Manager, collection launch gates, the liquidation bonding curve, and token escrow.

The smaller contracts that round out NFTX v4: the manager registry that guards Locker access, the launch gates that decide who can create a collection, the bonding curve used for liquidation auctions, and the escrow that holds claimable balances.

## LockerManager

Tracks which contracts are approved to access tokens held in the [Locker](/contracts/locker). Approvals are managed by the owner; when a vault is removed, its permissions are revoked to keep the protocol consistent. Signatures come from the `ILockerManager` interface.

### `setManager`

Approves or revokes a manager. Intended for migrations — e.g. disabling an old Listings contract while enabling a new one.

```solidity
function setManager(address _manager, bool _approved) external;
```

**Access:** `onlyOwner`. Reverts on the zero address or a no-op state change.

{% hint style="warning" %}
Having multiple managers enabled at once can be dangerous: if they interact with assets registered on another contract, they can cause protocol issues.
{% endhint %}

| Parameter   | Type      | Description            |
| ----------- | --------- | ---------------------- |
| `_manager`  | `address` | The contract to update |
| `_approved` | `bool`    | The new approval state |

**Returns:** None.

### `isManager`

Returns whether an address is an approved Locker manager.

```solidity
function isManager(address _manager) external view returns (bool);
```

| Parameter  | Type      | Description          |
| ---------- | --------- | -------------------- |
| `_manager` | `address` | The address to check |

| Return    | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| (unnamed) | `bool` | `true` if the manager is approved |

## Launch gates

A launch gate is the external, swappable authority the Locker consults to decide who may create or initialize a collection, and whether token-only (single-sided) liquidity launches are allowed. The interface is `ICollectionLaunchGate`; two implementations ship.

{% hint style="info" %}
The auth methods are declared non-`view` on the interface so a future gate can hold stateful policy without breaking the interface.
{% endhint %}

| Function                                                            | Description                                                                 |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `assertCanCreateCollection(address caller, address collection)`     | Reverts unless `caller` may create `collection` through this gate           |
| `assertCanInitializeCollection(address caller, address collection)` | Reverts unless `caller` may initialize `collection` through this gate       |
| `singleSidedAllowed()` → `bool`                                     | Whether token-only single-sided launches are permitted; fixed at deployment |

**Implementations:**

* **`Public`** — permissionless. `assertCanCreateCollection` and `assertCanInitializeCollection` are no-ops, so anyone may create or initialize a collection.
* **`WhiteGlove`** — restricted. Both assertions revert with `LaunchRestricted` unless the caller is the owner (multisig), so only the multisig can create or initialize collections.

## LinearRangeCurve

A Sudoswap-compatible bonding curve used by [Collection Shutdown](/contracts/collection-shutdown) liquidations. Price declines linearly over a time range until it reaches zero, prioritising a predictable liquidation schedule over price discovery; buys don't move the spot price and sells aren't allowed.

### `getBuyInfo`

Computes how much a buyer pays to purchase NFTs from the pool, along with the new pool state.

```solidity
function getBuyInfo(uint128 spotPrice, uint128 delta, uint numItems, uint feeMultiplier, uint protocolFeeMultiplier) external view returns (Error error, uint128 newSpotPrice, uint128 newDelta, uint inputValue, uint tradeFee, uint protocolFee);
```

| Parameter               | Type      | Description                                                     |
| ----------------------- | --------- | --------------------------------------------------------------- |
| `spotPrice`             | `uint128` | The current selling spot price, in tokens                       |
| `delta`                 | `uint128` | The curve's delta parameter (here, packed start/end timestamps) |
| `numItems`              | `uint`    | The number of NFTs being bought                                 |
| `feeMultiplier`         | `uint`    | The LP fee for this trade, 18 decimals                          |
| `protocolFeeMultiplier` | `uint`    | The protocol fee for this trade, 18 decimals                    |

| Return         | Type      | Description                                                 |
| -------------- | --------- | ----------------------------------------------------------- |
| `error`        | `Error`   | Math error code; only `Error.OK` means the values are valid |
| `newSpotPrice` | `uint128` | The updated selling spot price                              |
| `newDelta`     | `uint128` | The updated delta                                           |
| `inputValue`   | `uint`    | The amount the buyer should pay, in tokens                  |
| `tradeFee`     | `uint`    | The amount sent to the trade-fee recipient                  |
| `protocolFee`  | `uint`    | The protocol fee, in tokens                                 |

### `getSellInfo`

Selling is not supported — liquidation pools only buy. Always returns `Error.INVALID_NUMITEMS` with zero values.

```solidity
function getSellInfo(uint128, uint128, uint, uint, uint) external pure returns (Error error_, uint128, uint128, uint, uint, uint);
```

### `packDelta` / `unpackDelta`

Helpers to encode and decode the auction's start and end timestamps into the `delta` value.

```solidity
function packDelta(uint32 start, uint32 end) external pure returns (uint128);
function unpackDelta(uint128 delta) external pure returns (uint32 start_, uint32 end_);
```

| Parameter | Type      | Description                         |
| --------- | --------- | ----------------------------------- |
| `start`   | `uint32`  | The unix timestamp the curve starts |
| `end`     | `uint32`  | The unix timestamp the curve ends   |
| `delta`   | `uint128` | The packed delta to decode          |

| Return   | Type     | Description                 |
| -------- | -------- | --------------------------- |
| `start_` | `uint32` | The decoded start timestamp |
| `end_`   | `uint32` | The decoded end timestamp   |

{% hint style="info" %}
`validateDelta` and `validateSpotPrice` both return `true` for any value — a linear curve accepts all deltas and spot prices.
{% endhint %}

## TokenEscrow

A gas-efficient escrow that holds balances for users to claim later. ERC-20 amounts are sent directly to recipients; native ETH is held in escrow. It's inherited by [NFTXV4Hook](/contracts/nftx-v4-hook) and other contracts that accrue user-owed balances. Signatures come from the `ITokenEscrow` interface.

### `withdraw`

Withdraws from the caller's escrow position. Funds are always debited from `msg.sender` (the source can't be widened) but may be sent to any non-zero recipient.

```solidity
function withdraw(address _recipient, address _token, uint _amount) external;
```

**Access:** public. Reverts if `_amount` is 0, `_recipient` is the zero address, or the caller has insufficient balance. For the native token (`_token == NATIVE_TOKEN`, i.e. `address(0)`), transfers ETH; otherwise transfers the ERC-20.

| Parameter    | Type      | Description                                         |
| ------------ | --------- | --------------------------------------------------- |
| `_recipient` | `address` | The address to receive the token / ETH              |
| `_token`     | `address` | The token to transfer (`address(0)` for native ETH) |
| `_amount`    | `uint`    | The amount to transfer                              |

**Returns:** None.

### `balances` / `NATIVE_TOKEN`

```solidity
function balances(address _recipient, address _token) external view returns (uint amount_);
function NATIVE_TOKEN() external view returns (address);
```

| Function                       | Description                                                          |
| ------------------------------ | -------------------------------------------------------------------- |
| `balances(_recipient, _token)` | The escrow balance of `_token` allocated to `_recipient` (0 if none) |
| `NATIVE_TOKEN()`               | The sentinel address for native ETH (`address(0)`)                   |


# Audits

Who has reviewed the NFTX v4 contracts — manual audits by Sherlock and Hooks.wtf, plus regular AI-assisted review rounds built on Trail of Bits and Uniswap security skills.

NFTX v4 runs on **non-upgradeable** contracts, so a bug can't be patched in place after deployment. That makes review before deployment the main line of defense. The contracts have been through two kinds of review:

* **Manual audits** by independent security researchers at Sherlock and Hooks.wtf.
* **AI-assisted review rounds** that we run ourselves on a regular cadence, using open-source security skills published by Trail of Bits and Uniswap.

{% hint style="warning" %}
Audited does not mean risk-free. No matter how well reviewed a protocol is, there is always the possibility of uncaught vulnerabilities. Only deposit what you are comfortable putting at risk.
{% endhint %}

## Manual audits

### Sherlock

<figure><picture><source srcset="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-acc3c53bcbd5252838f6f091edce4bbecd5291f2%2Fsherlock-logo-dark.svg?alt=media" media="(prefers-color-scheme: dark)"><img src="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-99daaa37894de5c97b2fef926c485db3ca4979d2%2Fsherlock-logo.svg?alt=media" alt="Sherlock" width="280"></picture><figcaption></figcaption></figure>

[Sherlock](https://sherlock.xyz) ran a public audit contest on the codebase, where independent security researchers compete to find vulnerabilities and a lead senior auditor reviews alongside them. The contest ran under the protocol's original name, **Flayer** — the codebase that NFTX v4 is built on.

* **Format:** public audit contest, 72,500 USDC prize pool
* **Dates:** 2 – 15 September 2024
* **Lead security expert:** zzykxx, alongside 80 other researchers who found valid issues
* **Scope:** the core contracts — [Locker](/contracts/locker), [Listings](/contracts/listings), [Collection Token](/contracts/collection-token), [Tax Calculator](/contracts/tax-calculator), the Uniswap V4 hook implementation, [Collection Shutdown](/contracts/collection-shutdown) and their supporting contracts
* **Result:** the final report lists 25 high-severity and 22 medium-severity issues, all public
* **Status:** all issues found have been acknowledged or remediated

Contracts added since the contest, such as the [NFTX Flex Hook](/contracts/nftx-flex-hook), were not part of the contest scope; they are covered by the review rounds described below.

{% file src="/files/SCjocSJ9ku1IXooB0Ryz" %}
Sherlock's final security review for Flayer (PDF, 179 pages).
{% endfile %}

The full contest details, including the detailed scope, are on the [Sherlock contest page](https://audits.sherlock.xyz/contests/468).

### Hooks.wtf

<figure><picture><source srcset="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-6e3803f09b48a7f97a12ea2109d2d4ee864a9c4e%2Fhooks-wtf-logo-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-5c15cf452506ac7354a9ac62af3cf714a159a86f%2Fhooks-wtf-logo.png?alt=media" alt="Hooks.wtf" width="240"></picture><figcaption></figcaption></figure>

[Hooks.wtf](https://hooks.wtf) is a Uniswap V4 specialist agency. They carried out a manual audit of the core NFTX v4 contracts, and the full report is published on their site.

* **Format:** manual audit
* **Audited commit:** `6e4a1f6`
* **Scope:** [Locker](/contracts/locker), [Listings](/contracts/listings), the [NFTX V4 Hook](/contracts/nftx-v4-hook) and [NFTX Flex Hook](/contracts/nftx-flex-hook), [Collection Shutdown](/contracts/collection-shutdown), and the [Zap](/contracts/zap) and [Migrator Zap](/contracts/migrator-zap)
* **Result:** every issue raised is of medium severity or below. The report found no path that mints a collection token without depositing an NFT, none that removes an NFT from the Locker without burning a token, and no gaps in access control.
* **Status:** all issues found have been acknowledged or remediated

None of the issues put deposited NFTs or LP principal at risk of theft. They do allow fees to be diverted away from LPs, buyers to overpay when using the zap, and core flows to be blocked at very little cost to the caller. The audit assumes the contract owner is trusted; collection creators, listers, LPs, swappers and the NFT contracts themselves are all treated as untrusted.

<a href="https://nftx-audit-001.hooks.wtf/" class="button primary">View the Hooks.wtf report</a>

## AI-assisted review rounds

A one-off audit covers the code as it stood on one day. NFTX v4 keeps shipping new contracts, so between manual audits we run regular AI-assisted security reviews against the current code. Each round is a set of independent passes over the contracts, and each pass follows a published security skill — a written methodology that tells the reviewing agent what to look for and how.

{% hint style="info" %}
These rounds are run by the NFTX team using open-source skills that Trail of Bits and Uniswap publish. They are not audits performed by Trail of Bits or by Uniswap Labs, and neither organization has reviewed or endorsed NFTX.
{% endhint %}

### Trail of Bits skills

<figure><picture><source srcset="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-c5ca1a925a0bcffdd567406195bda49bd5bc3b1f%2Ftrail-of-bits-logo-dark.svg?alt=media" media="(prefers-color-scheme: dark)"><img src="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-f86f0dc16ba06d25fd8b62c4bfccd889f6fde83f%2Ftrail-of-bits-logo.svg?alt=media" alt="Trail of Bits" width="180"></picture><figcaption></figcaption></figure>

[Trail of Bits](https://www.trailofbits.com) publishes its smart contract review methodology as open-source [skills](https://github.com/trailofbits/skills). Our rounds use:

* **Entry-point analysis and audit context building** — map every externally callable function and the trust assumptions behind it before hunting for bugs.
* **Secure workflow and development guidelines** — check the codebase against Trail of Bits' secure development practices.
* **Token integration analysis** — check how the contracts handle the ERC20 and ERC721 tokens they touch, including non-standard ones.
* **Variant analysis** — once a bug is found, search the rest of the codebase for the same pattern.

### Uniswap skills

<figure><img src="https://28497356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX3gO8jlVac9EJva8tztA%2Fuploads%2Fgit-blob-238cd325a93e5fdedd6a982438614d794d36077e%2Funiswap-logo.svg?alt=media" alt="Uniswap" width="220"><figcaption></figcaption></figure>

Uniswap publishes AI skills for building on the protocol in [uniswap-ai](https://github.com/Uniswap/uniswap-ai). We use its **v4 security foundations** skill, a threat model written specifically for Uniswap V4 hooks. It covers hook permissions, delta accounting, access control on hook callbacks, and the ways a hook can be manipulated through the pool it is attached to. Both the [NFTX V4 Hook](/contracts/nftx-v4-hook) and the [NFTX Flex Hook](/contracts/nftx-flex-hook) are reviewed against it.

### How a round works

1. **Scope.** A round targets a specific commit, usually ahead of a release or after a large batch of changes has merged. Anything documented in an earlier round is excluded, so each round looks for new issues.
2. **Review.** Several passes run in parallel, each following one of the skills above. When independent passes land on the same defect, we treat that as a strong signal.
3. **Triage and fix.** Every finding gets a severity and is either fixed or recorded with the reason the risk was accepted. After a large merge we also re-verify earlier fixes against the merged code, to catch regressions.

AI-assisted review is a complement to manual audits, not a replacement. It is cheap enough to repeat every time the code changes, which a manual audit is not, but it can miss issues a human auditor would catch and can report issues that turn out not to be real. We treat its output as leads to verify by hand, not as verdicts.

## Bug bounty

There is currently no active bug bounty for NFTX v4. If that changes, the program details will be published on this page.


# Overview

Why Art Blocks projects need a wrapper before they can become an NFTX collection, and how wrapping works end to end.

Most NFT collections are one contract. Art Blocks is not. A single Art Blocks core contract holds many separate projects — the V0 core alone carries Chromie Squiggle, Genesis and Construction Token — and tells them apart inside the token ID rather than at the contract address.

That collides with how NFTX identifies a collection. The [Locker](/contracts/locker) keys everything on the ERC-721 address alone, so pointing it at an Art Blocks core would fold every project on that core into one indiscriminate vault. A Squiggle and a Construction Token would mint the same floor token, and the floor price would be whichever of them was cheapest. That isn't a floor — it's an average of unrelated things.

Wrappers fix this. Each Art Blocks project gets its own ERC-721 contract, backed one-for-one by the originals, and *that* is what NFTX registers.

{% hint style="info" %}
Art Blocks wrappers are **Ethereum Mainnet only**. The flagship Art Blocks core contracts exist nowhere else, so there is nothing to wrap on any other chain.
{% endhint %}

## How Art Blocks encodes a project

Every core reserves a million token IDs per project, and the ID carries the project inside it:

```
tokenId = projectId × 1,000,000 + tokenNumber
```

So Chromie Squiggle is project `0` and its tokens run `0`–`999999`. Fidenza is project `78`, so its first token is `78000000`. Divide any token ID by a million and you have its project; take the remainder and you have its number within that project.

The wrapper uses exactly this arithmetic. Wrapped token IDs are the *token number* — the remainder — so Fidenza `78000123` wraps to `123`. Each wrapper serves one project, so the number alone is unambiguous inside it.

## What a wrapper is

One ERC-721 contract per `(core, projectId)` pair, deployed as a minimal-proxy clone by the [Wrapper Factory](/art-blocks/wrapper-factory). Deposit an original and you receive a wrapped token; return the wrapped token and you get your original back, whenever you like. Custody is strictly 1:1 — every wrapped token in existence is backed by exactly one original held by that wrapper.

The wrapper stores no metadata of its own. Its name, its `tokenURI` and the generative `tokenHash` are all read live from the core on every call, so an Art Blocks metadata migration shows up in the wrapper immediately, with nothing to re-sync.

{% hint style="warning" %}
Wrapping is a real transfer. While a token is wrapped, the wrapper contract holds your original on the core — so it will not appear in your wallet, and anything keyed on holding the original (allowlists, snapshots, token-gated access) will not see you. Unwrapping is permissionless and always available, but be deliberate about wrapping something you need to hold.
{% endhint %}

## The path to a live collection

{% stepper %}
{% step %}

### The core is registered

The factory only deploys wrappers for Art Blocks cores we have registered. That list is curated — see [Registered cores](/art-blocks/wrapper-factory#registered-cores).
{% endstep %}

{% step %}

### Anyone deploys the wrapper

`deployWrapper(core, projectId)` is permissionless for any registered core, and one-time per project. Its address is deterministic and can be read before it exists.
{% endstep %}

{% step %}

### Holders wrap their tokens

Either send the original to the wrapper with `safeTransferFrom`, or approve the wrapper and call `wrap`. Both mint you the wrapped token.
{% endstep %}

{% step %}

### The wrapper launches as an NFTX collection

From here it is an ordinary ERC-721 to the protocol — it launches, mints a floor token, and trades like any other collection.
{% endstep %}
{% endstepper %}

## Contracts

| Contract                                   | Address                                      |
| ------------------------------------------ | -------------------------------------------- |
| `ArtBlocksWrapperFactory`                  | `0x60BDb946Fc17C10210d2e8e6DC3bc3f5415989FC` |
| `ArtBlocksProjectWrapper` (implementation) | `0x2075a2574F6D0187FBB311162135fdc31853316F` |

Deployed wrappers so far:

| Project                                   | Core       | Wrapper                                      |
| ----------------------------------------- | ---------- | -------------------------------------------- |
| Chromie Squiggle by Snowfro (project `0`) | AB Core V0 | `0x9f8a420f2E0aB9651230fC39Df660dA5157B39A3` |

## What wrappers deliberately do not have

No owner, no pause, no fees, no upgrade path. The wrapper is a custody contract and nothing else, and the factory's ownership reaches only the registry of approved cores — it can never touch a wrapper or the tokens inside one.

One consequence is worth stating plainly: a wrapper trusts its core, because it proxies metadata from it and relies on it to report transfers honestly. A misbehaving core can therefore degrade the wrapper bound to it. It cannot reach any other wrapper, and it cannot reach the factory.

<table data-view="cards"><thead><tr><th>Page</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td>Deploying wrappers and the core registry</td><td><a href="/art-blocks/wrapper-factory">Wrapper Factory</a></td></tr><tr><td>Wrapping, unwrapping and metadata</td><td><a href="/art-blocks/project-wrapper">Project Wrapper</a></td></tr></tbody></table>


# Wrapper Factory

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

`ArtBlocksWrapperFactory` deploys one [project wrapper](/art-blocks/project-wrapper) 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.


# Project Wrapper

ArtBlocksProjectWrapper — wrapping and unwrapping Art Blocks tokens, the ID mapping, live metadata proxying, and the recovery path.

`ArtBlocksProjectWrapper` is the ERC-721 that stands in for a single Art Blocks project. One clone exists per `(core, projectId)` pair, deployed by the [Wrapper Factory](/art-blocks/wrapper-factory), and it holds the originals backing every wrapped token it has issued.

Custody is strictly 1:1. `totalSupply` always equals the number of originals the wrapper legitimately holds on the core — there is no path that mints a wrapped token without an original behind it.

## Token IDs

A wrapped token's ID is the underlying's **token number** — the part after the project prefix:

```
wrappedId = underlyingId % 1,000,000
```

Fidenza `78000123` wraps to `123`. Since each wrapper serves exactly one project, that number is unambiguous within it. Two helpers do the conversion for you:

```solidity
function underlyingTokenId(uint _wrappedId) returns (uint underlyingId_);
function wrappedTokenId(uint _underlyingId) returns (uint wrappedId_);
```

## Wrapping

Two supported routes, and they mint the same thing:

{% tabs %}
{% tab title="safeTransferFrom" %}
Send the original to the wrapper. The receiver hook mints your wrapped token in the same transaction.

```solidity
IERC721(core).safeTransferFrom(msg.sender, wrapper, 78000123);
// -> you now hold wrapped token 123
```

{% endtab %}

{% tab title="approve + wrap" %}
Approve the wrapper on the core, then have it pull the token.

```solidity
IERC721(core).setApprovalForAll(wrapper, true);
IArtBlocksProjectWrapper(wrapper).wrap(78000123);
// -> returns 123, minted to you
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Do **not** deposit with a plain `transferFrom`. It triggers no receiver callback, so no wrapped token is minted and the wrapper cannot tell who sent it. The token is not lost, but claiming it becomes a race — see [Recovery](#recovery).
{% endhint %}

## Unwrapping

```solidity
function unwrap(uint _wrappedId, address _recipient);
```

Burns your wrapped token and releases the original to `_recipient`. Always available, with no owner able to prevent it and no fee.

Two recipients are rejected outright: the zero address, which would destroy the wrapped token and strand the original, and the wrapper itself, which would re-enter the receiver hook and re-mint a wrapped token belonging to nobody. Both revert rather than silently doing something surprising.

## Recovery

```solidity
function recover(uint _underlyingId) returns (uint wrappedId_);
```

The escape hatch for an original that arrived via plain `transferFrom` and so never minted a wrapped token. It mints one to the caller, but only for a token the wrapper verifiably holds on the core with no wrapped counterpart already in existence.

{% hint style="danger" %}
Recovery is **first-caller-claims**. With no admin, there is no way for the contract to know who originally sent the token, so anyone may claim it. If you have deposited by plain `transferFrom`, call `recover` in the same transaction — otherwise you are racing whoever spots it first.
{% endhint %}

A token from a *different* project that gets forced into the wrapper can never be claimed here: the check is keyed on the wrapper's own project, never on what the caller asks for. Such tokens stay where they are, permanently. Treat them as donations.

## Metadata

Nothing is stored locally and nothing is snapshotted — every metadata call resolves against the core at read time, so any Art Blocks migration is reflected the moment it happens.

| Function        | Behaviour                                                                    |
| --------------- | ---------------------------------------------------------------------------- |
| `name()`        | The core's current project name, read live                                   |
| `symbol()`      | Derived as `wAB<projectId>-<CORE4HEX>` — e.g. `wAB78-D270` for Fidenza on V1 |
| `tokenURI(id)`  | Forwarded to the core's renderer for the underlying token                    |
| `tokenHash(id)` | The generative hash, resolved across core versions                           |

If the core reverts, that revert bubbles up unchanged. We would rather serve no metadata than fabricate it.

## Events

| Event                                                                                                           | Fired when                                          |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `TokenWrapped(address indexed _owner, uint256 indexed _wrappedId, uint256 _underlyingId)`                       | An original is wrapped                              |
| `TokenUnwrapped(address indexed _owner, address _recipient, uint256 indexed _wrappedId, uint256 _underlyingId)` | A wrapped token is burned and the original released |
| `TokenRecovered(address indexed _claimant, uint256 indexed _wrappedId, uint256 _underlyingId)`                  | An unbacked deposit is claimed                      |

Standard ERC-721 `Transfer` and `Approval` events fire as usual but are not indexed by the NFTX subgraph — the three events above already capture every mint and burn, and per-token ownership is out of the indexer's scope.

## Safety envelope

No owner, no pause, no fees, no upgrade path. Nobody — not the factory, not its owner, not us — can move a token out of a wrapper except its holder, by unwrapping.

The one trust assumption is the core itself: the wrapper proxies metadata from it and depends on it to report transfers truthfully. Both `wrap` and `unwrap` assert ownership on the core *after* the transfer, so a core that lies about having moved a token reverts loudly instead of leaving an unbacked wrapped token behind. A misbehaving core can still degrade the wrapper bound to it, but it can reach no other wrapper and not the factory.


# Overview

The NFTX v4 API — a read-only REST interface for reading collections, listings, activity, prices, portfolios, and swap quotes.

The NFTX v4 API is a **read-only** REST interface over the protocol. Use it to read collection data, listings, activity, holders, prices, and user portfolios, and to fetch swap quotes and transaction calldata your own wallet then submits. It's the fastest way to build on NFTX without indexing the chain yourself.

{% hint style="info" %}
The API is **public and read-only** — no API key or authentication is required. Nothing here moves funds: swap endpoints return a quote and an unsigned payload that **your** wallet signs and submits.
{% endhint %}

## Base URL and chains

Every protocol route is scoped to a chain:

```
/v1/{chain}/...
```

`{chain}` is a numeric chain ID or one of its slug aliases. The API supports:

| Chain                             | Chain ID   | Aliases                                                      |
| --------------------------------- | ---------- | ------------------------------------------------------------ |
| Ethereum Mainnet                  | `1`        | `mainnet`, `ethereum`, `eth`                                 |
| Arbitrum One                      | `42161`    | `arbitrum`, `arbitrum-one`, `arb`, `arb-mainnet`             |
| Ink                               | `57073`    | `ink`, `ink-mainnet`                                         |
| Robinhood Chain                   | `4663`     | `robinhood`, `robinhood-chain`, `rh`                         |
| Ethereum Sepolia (testnet)        | `11155111` | `sepolia`, `eth-sepolia`, `ethereum-sepolia`                 |
| Robinhood Chain Testnet (testnet) | `46630`    | `robinhood-testnet`, `robinhood-chain-testnet`, `rh-testnet` |

For example, listing collections on Robinhood Chain is `GET /v1/4663/collections`, and on Ethereum Mainnet `GET /v1/1/collections` (or `GET /v1/ethereum/collections`).

{% hint style="info" %}
Requests for any chain outside this table return `400 UNSUPPORTED_CHAIN`. Base Mainnet (`8453`) and Base Sepolia (`84532`) are no longer served; their deployments still exist on-chain, and their addresses remain in [Deployment Addresses](/contracts/addresses).
{% endhint %}

## What's inside

| Group                                     | What it covers                                               |
| ----------------------------------------- | ------------------------------------------------------------ |
| [System](/api-reference/system)           | Health, readiness, protocol config and stats                 |
| [Collections](/api-reference/collections) | Collection data, tokens, holders, traits, prices, liquidity  |
| [Activity](/api-reference/activity)       | Global, collection-, token-, and user-scoped activity feeds  |
| [Listings](/api-reference/listings)       | Liquid and Dutch listings for a collection or a single token |
| [Search](/api-reference/search)           | Search across collections and tokens                         |
| [Users](/api-reference/users)             | Portfolio, balances, listings, escrow, votes, positions      |
| [Swaps](/api-reference/swaps)             | Quotes, approval checks, and executable swap calldata        |
| [Realtime](/api-reference/realtime)       | Streaming protocol events                                    |
| [Vaults](/api-reference/vaults)           | Vault creation preflight checks                              |
| [Test tokens](/api-reference/test-tokens) | Test-token metadata and images (testnet)                     |

## About this spec

The reference below is generated live from the NFTX v4 API's OpenAPI specification, served at [`nftx-v4-api-production.up.railway.app/openapi.json`](https://nftx-v4-api-production.up.railway.app/openapi.json). The API service emits this spec via its `openapi:emit` build step, so the reference stays in step with the deployed API.

{% hint style="info" %}
A point-in-time copy of the spec is also committed to this repository at [`api-reference/nftx-v4-api.json`](https://github.com/flayerlabs/nftx-v4-gitbook/tree/main/api-reference/nftx-v4-api.json) as an offline snapshot. The live endpoint above is the source of truth that the operation blocks render from.
{% endhint %}


# System

Health, readiness, metrics, and protocol configuration and stats.

Operational endpoints for checking service health and reading protocol-level configuration and statistics (TVL, fees, volume). Health, readiness, and metrics are not chain-scoped; the protocol endpoints take a `{chain}`.

## Service health

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/health" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/ready" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/metrics" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

## Protocol configuration and stats

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/protocol/config" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/protocol/stats" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Collections

Collection data — tokens, holders, traits — plus prices, liquidity, swaps, and shutdown status.

Everything about a collection and its tokens: core details, the tokens in the pool, holders and traits, and the market data that sits on top (OHLC candles, price history, liquidity, and the buy/sell swap feed). A collection is identified by its contract `{collection}` address.

## Collections

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/holders" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/traits" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/shutdown" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

## Tokens

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens/search" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens/{tokenId}" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens/{tokenId}/owners" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens/{tokenId}/transfers" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

## Market data

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/ohlc" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/price-history" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/swaps" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/pools" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/liquidity" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/liquidity-flow" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Activity

Activity feeds — global, per collection, per token, and per user.

Chronological feeds of protocol activity. Read the whole chain's activity, or scope it to a single collection, a single token, or a single user's address.

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/activity" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/activity" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/tokens/{tokenId}/activity" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/activity" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Listings

Liquid and Dutch listings for a collection or a single token.

Read the listings sitting in a collection's pool. Fetch every listing for a collection, or look up the listing for one specific token.

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/collections/{collection}/listings" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/listings/{collection}/{tokenId}" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Search

Search across collections and tokens.

A single search endpoint across collections and tokens.

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/search" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Users

User-scoped reads — portfolio, token balances, listings, escrow, votes, and liquidity positions.

Everything tied to a wallet `{address}`: a portfolio overview, token balances, the user's own listings, escrow balances waiting to be claimed, governance votes, swappable routes, vaults they created, and their liquidity positions.

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/portfolio" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/token-balances" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/listings" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/escrow" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/votes" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/swappable-routes" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/created-vaults" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/users/{address}/liquidity-positions" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Swaps

Swap quotes, approval checks, and executable calldata. The API prices and builds the transaction; your wallet signs and submits it.

The swap endpoints price a trade and hand back an **unsigned** transaction your wallet then submits — the API never holds funds or keys. The usual flow is: quote → check approval → fetch calldata → submit from your wallet. Some routes proxy the Uniswap Trading API behind the scenes.

{% hint style="info" %}
These are `POST` endpoints because they take a request body describing the trade. They return data (a quote, an approval action, or calldata); they do not execute anything on-chain themselves.
{% endhint %}

## Quote and approval

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/swaps/quote" method="post" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/swaps/check-approval" method="post" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

## Calldata and plans

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/swaps/calldata" method="post" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/swaps/buy-from-pool/plan" method="post" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/swaps/cross-collection/plan" method="post" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Realtime

Stream protocol events as they happen.

Subscribe to a stream of protocol events instead of polling. Point a client at the events endpoint and receive updates as they land.

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/events/stream" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Vaults

Preflight checks before creating a vault.

Run preflight checks for vault creation — validate inputs and surface any blockers before you send a `createCollection` transaction on-chain (see [Locker](/contracts/locker)).

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/vaults/preflight" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Test Tokens

Metadata and images for test tokens on testnet.

Metadata and image endpoints for the test ERC-721 tokens minted by the testnet-only `TestERC721Factory`. Handy when building and testing against Ethereum Sepolia or Robinhood Chain Testnet.

{% hint style="info" %}
`TestERC721Factory` is deployed on every testnet — see [Deployment Addresses](/contracts/addresses) for the addresses and a minting example. Pass `sepolia` or `robinhood-testnet` as `{chain}` to reach the tokens on each. The factory is also deployed on Base Sepolia, which the API no longer serves.
{% endhint %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/test-tokens/{contract}/{tokenId}" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}

{% openapi src="<https://nftx-v4-api-production.up.railway.app/openapi.json>" path="/v1/{chain}/test-tokens/{contract}/{tokenId}/image" method="get" %}
<https://nftx-v4-api-production.up.railway.app/openapi.json>
{% endopenapi %}


# Overview

These docs are built for AI agents as well as people — connect via MCP, pull LLM-ready markdown, and follow our best practices for building on NFTX with AI.

More and more developers build with an AI coding agent at their side — and more and more of this documentation is read by machines, not just people. This section is for both. It shows how to point an agent at the **live, authoritative** NFTX docs, and how to build on NFTX safely when an AI is writing some of the code.

Three things are worth knowing:

* [**Connect via MCP**](/agentic-development/mcp-server) — a hosted Model Context Protocol server that lets your AI client search and read these docs in real time.
* [**LLM-Ready Docs**](/agentic-development/llm-ready-docs) — every page is available as clean markdown, alongside `llms.txt` / `llms-full.txt` indexes and an in-docs AI assistant you can simply ask.
* [**Best Practices**](/agentic-development/best-practices) — how to get accurate, current answers out of an agent, and how to keep on-chain work safe.

{% hint style="info" %}
**Why it matters:** an agent working from its training data is working from a snapshot that may be months out of date. Pointed at these docs, it works from the *current* contract addresses, function signatures, fee parameters, and API — the same source of truth this site is built from.
{% endhint %}

<table data-view="cards"><thead><tr><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Connect via MCP</strong></td><td>Point your AI client at the live docs.</td><td><a href="/agentic-development/mcp-server">Connect via MCP</a></td></tr><tr><td><strong>LLM-Ready Docs</strong></td><td>Markdown, llms.txt, and the AI assistant.</td><td><a href="/agentic-development/llm-ready-docs">LLM-Ready Docs</a></td></tr><tr><td><strong>Best Practices</strong></td><td>Build on NFTX with AI, safely.</td><td><a href="/agentic-development/best-practices">Best Practices</a></td></tr></tbody></table>


# Connect via MCP

Connect your AI client to a hosted MCP server that searches and reads the live NFTX docs.

GitBook publishes these docs with a hosted **Model Context Protocol (MCP)** server — a standard interface that lets an AI client search and read the documentation directly, in real time. Point your agent at it and questions about NFTX get answered from *this* site, not from a stale training snapshot.

## The endpoint

```
https://gitbook.flaunch.gg/nftx/~gitbook/mcp
```

It's **read-only**: a connected client can search the docs, retrieve specific pages, and answer questions from the published content. Nothing it does can change the docs or touch the chain.

{% hint style="info" %}
This is the endpoint for public content. GitBook also exposes `…/~gitbook/mcp/auth` for sites that gate part of their content behind authentication — you won't need it for these public docs.
{% endhint %}

## Add it to your client

Every AI tool configures MCP servers a little differently, but it comes down to handing it the URL above. A few common ones:

{% tabs %}
{% tab title="Claude Code" %}

```bash
claude mcp add --transport http nftx-docs https://gitbook.flaunch.gg/nftx/~gitbook/mcp
```

Then start a session and ask about NFTX — the agent calls the docs server whenever it needs an answer.
{% endtab %}

{% tab title="Cursor / VS Code" %}
Add the server to your MCP config (for example `.cursor/mcp.json` or `.vscode/mcp.json`):

```json
{
  "mcpServers": {
    "nftx-docs": {
      "url": "https://gitbook.flaunch.gg/nftx/~gitbook/mcp"
    }
  }
}
```

{% endtab %}

{% tab title="Claude Desktop" %}
Claude Desktop reaches remote servers through the `mcp-remote` bridge. In `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "nftx-docs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://gitbook.flaunch.gg/nftx/~gitbook/mcp"]
    }
  }
}
```

{% endtab %}
{% endtabs %}

For anything else, check your tool's own MCP setup guide and use the endpoint above.

## What to do with it

Once connected, ask the way you'd ask a teammate who has read all the docs:

* "How does the NFTX listing tax scale with the floor multiple?"
* "What's the Locker's `redeem` signature, and which contract holds it?"
* "Which endpoint returns a swap quote and calldata?"

The agent searches the docs, pulls the relevant pages, and answers from them. For the underlying files those answers are built from, see [LLM-Ready Docs](/agentic-development/llm-ready-docs).


# LLM-Ready Docs

Every page as clean markdown, plus llms.txt / llms-full.txt indexes, a live query parameter, and the in-docs GitBook Assistant.

You don't need MCP to feed these docs to a model. Every page is published in machine-friendly formats that any LLM or script can pull directly.

## Every page as markdown

Add `.md` to any page URL to get the raw markdown instead of the rendered HTML — smaller, cleaner, and cheaper for a model to read:

```
https://gitbook.flaunch.gg/nftx/how-it-works/floor-tokens.md
```

## llms.txt and llms-full.txt

GitBook keeps two index files at the site root, always in sync with the docs:

| File                                                             | What it is                                                                                                             |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [`llms.txt`](https://gitbook.flaunch.gg/nftx/llms.txt)           | A compact index — every page and its markdown URL — so an agent can discover what exists and fetch only what it needs. |
| [`llms-full.txt`](https://gitbook.flaunch.gg/nftx/llms-full.txt) | The entire documentation in a single file, ready to drop into a model's context as one blob.                           |

Use `llms.txt` when you want the agent to navigate; use `llms-full.txt` when you want the whole thing in context at once.

## Ask a page directly

Any markdown page can also answer questions inline. Append an `ask` parameter (and an optional `goal`) to a `.md` URL, and GitBook returns an answer assembled from the relevant pages, with source links and suggested follow-ups:

```
https://gitbook.flaunch.gg/nftx/contracts/listings.md?ask=How is listing tax refunded?
```

This is handy from a script or a single tool call when you want a targeted answer without wiring up a full MCP client.

## Ask in the docs: GitBook Assistant

These docs also ship with **GitBook Assistant**, an in-page AI you can simply talk to. Open it by:

* pressing <kbd>⌘</kbd>/<kbd>Ctrl</kbd> + <kbd>I</kbd>,
* clicking the Assistant button next to the search bar, or
* typing a question into the **Ask or search…** bar and choosing **Ask…**.

It uses agentic retrieval — taking into account the page you're on and what you've already read — to answer from the documentation. It's the fastest way to get an answer without leaving the page.

{% hint style="info" %}
All of these read the same published content the site is built from, so they stay current automatically as the docs change.
{% endhint %}


# Best Practices

How to get accurate, current answers from an AI agent building on NFTX — and how to keep on-chain work safe.

Building on NFTX with an AI agent is fast, but the rules that make good software still apply — plus a few that matter more when value moves on-chain. Here's how we recommend working.

## Give the agent the real source

* **Connect the docs; don't rely on memory.** Point your agent at the [MCP server](/agentic-development/mcp-server) or the [LLM-ready files](/agentic-development/llm-ready-docs) so it answers from the current documentation, not a training snapshot that may predate v4. This is the single biggest quality win.
* **Prefer markdown over scraping.** Use the `.md` pages, `llms.txt`, and `llms-full.txt` rather than parsing the rendered site — it's cleaner and less error-prone.
* **Cite the canonical pages.** For mechanics, lean on [How It Works](/how-it-works/floor-tokens) and [Core Concepts](/core-concepts/vaults); for the exact surface, the [Contracts](/contracts/contracts) and [API Reference](/api-reference/api-reference).

## Verify anything on-chain

* **Check addresses against the source.** Never trust a contract address an agent produced from memory — confirm it against [Deployment Addresses](/contracts/addresses), per chain.
* **Confirm signatures and parameters.** Function names, arguments, and fee parameters change between versions. Verify generated calls against the [Contracts](/contracts/contracts) reference — for example, the listing tax formula and the 2.00x kink live in the [Tax Calculator](/contracts/tax-calculator).
* **Treat generated Solidity and calldata as a draft.** Read it, test it, and don't ship it just because it compiles.

## Test before you spend

* **Use testnet first.** Every testnet deployment is in [Deployment Addresses](/contracts/addresses), and the API's preflight checks and [test-token](/api-reference/test-tokens) endpoints let you dry-run flows before touching mainnet.
* **Let the API build the transaction.** For swaps, the [Swaps](/api-reference/swaps) endpoint prices and builds the calldata; your wallet signs and submits. That's a smaller surface for an agent to get wrong.

## Keep a human in the loop

* **Approve every transaction yourself.** An agent can draft a transaction; a person should sign it. Don't give an agent keys that can move funds unattended.
* **Never paste secrets into a prompt.** Private keys and seed phrases don't belong in an agent's context, ever.
* **Remember: audited ≠ risk-free.** NFTX runs on non-upgradeable, audited contracts, but no protocol is immune to bugs. Size your early positions accordingly and stay cautious.

{% hint style="success" %}
The short version: **connect the docs, verify on-chain facts against the reference, test on a testnet, and keep a human on the transaction button.**
{% endhint %}


