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

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

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.

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.

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.

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.

Beyond these, CollectionToken is a standard ERC-20 (with permit) — transfer, approve, balanceOf, allowance, and so on behave as usual.

Last updated

Was this helpful?