For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

function setManager(address _manager, bool _approved) external;

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

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.

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.

The auth methods are declared non-view on the interface so a future gate can hold stateful policy without breaking the interface.

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

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.

packDelta / unpackDelta

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

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

validateDelta and validateSpotPrice both return true for any value — a linear curve accepts all deltas and spot prices.

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

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

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

Last updated

Was this helpful?