Collections
Collections
A "Collection" in the context of Phosphor is a unique grouping of items linked or deployed to a smart contract on a network supported by Phosphor. This collection adheres to a specific token standard, either ERC721 or ERC1155. Each item within the collection is assigned a unique token ID based on a predetermined strategy. The functionalities of a collection can vary depending on the type of contract deployed.
A Collection has following characteristics:
- It groups together a set of items.
- It can be deployed or linked to a smart contract on a network supported by Phosphor.
- It implements a specific token standard, being either ERC721 or ERC1155.
- It has a token ID assignment strategy, which determines how the items within the collection receive their token IDs.
- It enables different functionalities based on the contract your deploy.
Token ID Assignment Strategy
Token ID Assignment Strategy | Contract Support | Item Locking | Contract Mint function |
---|---|---|---|
AUTOMATIC | ERC721, ERC1155 | Automatically assigns a token ID when locking an Item. | Expects a token ID when calling the mint function. A token with the ID is minted from the contract. |
MANUAL | ERC721, ERC1155 | Requires manually passing a token ID when locking an Item. | Expects a token ID when calling the mint function. A token with the ID is minted from the contract. |
EXTERNAL | ERC721 | No token ID required when locking an Item. | Expects no token ID when calling the mint function. Token ID will be assigned during the mint function. |
Contract setup
The following table lists the different ways to configure the smart contract for a collection.
Contract type | Description |
---|---|
Platform | The platform provides a few default contracts that a user can choose from, including FrozenERC721 , FrozenERC1155 , FlexibleERC721 , FlexibleERC1155 , and SignatureERC721 . See more on using platform contracts. |
Custom | The user provides a custom smart contract implementation subject to restrictions below. This is also referred to in our documentation as Bring Your Own Contract (BYOC). |
External | The user links the collection to an existing smart contract on a network supported by Phosphor. |
Learn how to configure collection contracts.
When using platform contracts, one can take advantage of a few embedded characteristics our template contracts offer, such as:
-
Full ownership: A user can specify the wallet that should be the owner of this contract. Contract owners can perform all functions defined by the contract and grant or revoke admin roles (the Phosphor platform, in this instance, is given an admin role).
-
Define Items as non-transferable or “soulbound”: A soulbound contract does not allow item owners to transfer their items. It disables all resale activities and marks the items' permanent ownership.
-
Editable metadata: Contracts with this characteristic enable the owner to change the metadata after the item is minted.
Restrictions
To ensure that a custom contract is compatible with the platform, the deployment process will check for specific capabilities.
To determine the token type of the contract, the contract must have one of the following capabilities:
ERC721
ERC1155
To mint NFTs through the platform, the contract must have one of the following capabilities:
ADMIN_MINT_SINGLE
ADMIN_MINT_SINGLE_URI
ADMIN_MINT_MULTIPLE
ADMIN_MINT_MULTIPLE_NO_ID
MINT_VOUCHER
Capabilities
The Capability abstraction is used throughout the Phosphor platform. A capability is an array of JSON objects containing the signatures of the related smart contract members (functions, events, etc.). A capability is associated with an Application Binary Interface (ABI).
Each time the platform interacts with a smart contract, it ensures that it has the required capabilities. This generic approach makes the platform compatible with a variety of smart contracts, even allowing users to bring their own custom contracts into the platform.
You can get the known capabilities ABIs from the public capabilities
endpoint.
Feature Mapping
The following table lists the most common capabilities and their equivalent platform features.
Note that not all capabilities are listed here, this is just a sample.
Capability | Feature |
---|---|
ERC 721, ERC 1155 | Collection contract deployment and item ownership transfer. |
CONTRACT_ROYALTY, PER_TOKEN_ROYALTY | Item and collection royalty management. |
ADMIN_MINT_SINGLE, ADMIN_MINT_SINGLE_URI, ADMIN_MINT_SINGLE_URI | Functions to mint a single NFT per transaction. |
MINT_VOUCHER | The function that mints NFTs based on the quantity of a voucher. |
ADMIN_MINT_MULTIPLE | The function that mints multiple NFTs in one transaction. |