Extensions Functions

These functions are functions called by extensions built for ERC721 and ERC1155 Creator Contracts

General Functions

chevron-righttokenExtensionhashtag

Get the extension that minted the specified token. If not minted by a token, will return the 0x0 address

Permissions: Public function callable by anyone.

function tokenExtension(uint256 tokenId) external view returns (address)

Extension Mangement

Functions used to manage installed extensions

chevron-rightgetExtensionshashtag

Gets a list of all registered extensions.

Permissions: Public function callable by anyone.

function getExtensions() view returns (address[] memory extensions)
chevron-rightregisterExtensionhashtag

Registers an extension, allowing it to access the mint function, and ability to set a token’s metadata URI or a base URI for that extension. The token URI for tokens minted by this extension will be baseURI<tokenID>. When registering an extension you can specify a third boolean parameter of "true" for baseURIIdentical to specify the token URI for all tokens to be identical (will not increment with appended tokenId).

Permissions: Owner/Admin function callable by contract owner only.

function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical)s, baseURI (string), baseURI (string)

function registerExtension(address extension, string calldata baseURI)
chevron-rightunregisterExtensionhashtag

Unregisters an extension and removes access to the mint function and all other extension capabilities.

Permissions: Owner/Admin function callable by contract owner only.

function unregisterExtension(address extension)
chevron-rightblacklistExtensionhashtag

Blacklists an extension, preventing future registrations of the address. This function also destroys all references to metadata associated with tokens created by this extension, making them effectively useless.

Permissions: Owner/Admin function callable by contract owner only.

chevron-rightsetApproveTransferExtensionhashtag

Set the overall contract's approve transfer extension (See how to Receive a Transfer Callback here). Applies to all tokens in the contract and takes precedent over any extension level approve transfer functionality. Unset by setting the extension to the 0x0 address.

Permissions: Owner/Admin function callable by contract owner only.

chevron-rightsetRoyaltiesExtensionhashtag

Override the royalties for all tokens minted by the specified extension

Permissions: Owner/Admin function callable by contract owner only.

Extension Metadata Functions

Functions used by extensions to set the metadata of tokens minted by the extension

chevron-rightsetBaseTokenURIExtensionhashtag

Sets the base URI for any tokens minted from this extension. Once set, the metadata URI will be base_uri/<tokenId> by default.

Permissions: Only callable by an extension

chevron-rightsetTokenURIPrefixExtensionhashtag

Sets a prefix for all tokens minted from this extension. If configured, and a token has a URI set, tokenURI will return <prefixURI><tokenURI>.

Permissions: Only callable by an extension

chevron-rightsetTokenURIExtensionhashtag

Set the tokenURI for a specific token minted from this extension. Useful if you want to do something with a dynamic metadata server and need sequential numbering of tokens. Various methods defined below.

Permissions: Only callable by an extension and only on token minted by the extension

Extension Logic Overriding

The powerful thing about Manifold Creator is the ability for extensions to fully override core functionality of NFT smart contracts. The following is a list of functionality extensions can override.

Metadata Handling

An extension can fully manage the token metadata logic by implementing the ICreatorExtensionTokenURI arrow-up-rightinterface.

If an extension implements this interface then all metadata logic will be deferred to the extension's tokenURI function.

Token Transfer Approval

An extension can control whether or not a token can be transferred. To do this, the extension must implement the IERC721CreatorExtensionApproveTransfer arrow-up-rightinterface (for ERC721) or the IERC1155CreatorExtensionApproveTransfer arrow-up-rightinterface (for ERC1155).

If an extension implements this interface, by default, all transfers will call the extension's approveTransfer function prior to every token transfer. An extension can enable/disable this by calling the setApproveTransferExtension function.

Token Burn Callback

An extension can receive a callback whenever a token is burned. To do this, the extension must implement the IERC721CreatorExtensionBurnable arrow-up-rightinterface (for ERC721) or the IERC1155CreatorExtensionBurnable arrow-up-rightinterface (for ERC1155).

If an extension implements this interface, every time a token is burned it will call the extension's onBurn function.

Royalties

An extension can define the royalties for any tokens they mint. To do this, the extension must implement the ICreatorExtensionRoyalties arrow-up-rightinterface.

If an extension implements this interface, the Creator Contract will defer all royalty lookups to the extension for tokens minted by it.

Minting

These are functions used by extensions to mint NFTs. NFTs minted by the extension will adhere to the extension's overriding logic.

ERC721

chevron-rightmintExtensionhashtag

Mints a token from the extension. Also can set token URI or token data (immutable for a token) if desired.

Token Data is useful if you wish to store additional data needed by the extension at no additional cost (e.g. mint ordering data).

Permissions: Only callable by an installed extension

chevron-rightmintExtensionBatchhashtag

Batch mints tokens from the extension. Also can set token URI or token data (immutable for a token) if desired.

Token Data is useful if you wish to store additional data needed by the extension at no additional cost (e.g. mint ordering data).

Permissions: Only callable by an installed extension

ERC1155

chevron-rightmintExtensionNewhashtag

Mints a completely new token with the given amount from an extension. If URI is empty, URI will fall back to the default URI configured.

Permissions: Only callable by an installed extension

chevron-rightmintExtensionExistinghashtag

Mints more of an existing token from the extension. Requires that the original token already exist and that it is not a token from an extension.

Permissions: Only callable by an installed extension

Last updated