Common Functions

Implementations

Common functions include code found in both ERC721 and ERC1155 Creator Contracts. These functions exist for either ERC721 or ERC1155 implementations. Implementation details can be found in the following smart contract files:

Administrative Functions

Functions for adding and removing contract admins and transferring contract ownership. Admin controls are implemented via AdminControl.sol.

getAdmins

Gets list of admins on the contract that have access to performing Owner/Admin functions.

Permissions: Public function callable by anyone.

function getAdmins() view returns (address[] memory admins)
approveAdmin

Adds wallet address as an Admin on the contract for performing Owner/Admin functions.

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

function approveAdmin(address admin)
revokeAdmin

Removes wallet address as an Admin on the contract from performing Owner/Admin functions.

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

isAdmin

Admin lookup via wallet address.

Permissions: Public function callable by anyone.

transferOwnership

Transfers ownership of the contract to a specified wallet address. Owner/Admin function callable by contract owner or admin only.

Permissions: Callable by contract owner only

setApproveTransfer

Set the address of a contract that implements the approveTransfer function of IERC721CreatorExtensionApproveTransfer and/or IERC1155CreatorExtensionApproveTransfer. If configured, it will call the contract's approveTransfer function to see whether or not a token can be transferred as long as

  1. The token was NOT minted by an extension or;

  2. The token was minted by an extension that does not have approve transfer callbacks enabled, or did not implement approve transfer callbacks

This functionality is useful if you want to enforce on transfer rules, such as the OpenSea Operator Filter Registry. Set to the 0x0000000000000000000000000000000000000000 address to disable.

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

getApproveTransfer

Gets the address of the contract that is checked for transfer approvals. Returns 0x0000000000000000000000000000000000000000 if no contract is configured.

Permissions: Public function callable by anyone.

Token Owner Functions

burn

Burns (destroys) a token or tokens. The token creator extension is notified when this occurs.

Permissions: Public function only callable by token owner.

Input Parameters: wallet address, tokenId(s), amounts

safeTransferFrom

Transfers ownership of a specific NFT from one address to another. When using safeTransferFrom the token contract checks to see that the receiver address is an IERC721Receiver, which implies that it knows how to handle ERC721 tokens (unlike the standard transferFrom function).

Permissions: Public function callable by token owner only

Input Parameters: from address, to address, tokenId

Metadata Functions

Metadata functions can add or modify a Token's URI, or Uniform Resource Identifier. This URI specifies the endpoint with information representing the NFT including its media and attributes, conforming to the ERC721 Metadata JSON Schema. This JSON is often hosted on decentralized protocols like Arweave, like we use within Manifold Studio.

setBaseTokenURI

Sets the base URI for any tokens created without an extension. Once set, the metadata URI will be base_uri/<tokenId> by default.

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

setTokenURIPrefix

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

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

setTokenURI

Sets a specific metadata URI for a given token created without an extension. Methods included for taking in both singular token values and arrays of multiple tokens/strings.

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

Royalty Functions

Functions for querying or setting royalties on a contract or specific token.

getFeeRecipients

Gets royalty recipients for a given tokenId. Standard interface identifier for Rarible royalties.

Permissions: Public function callable by anyone.

getFeeBps

Gets royalty percentage (bps) for a given tokenId. Standard interface identifier for Rarible royalties. Public function callable by anyone.

Permissions: Public function callable by anyone.

getFees

Gets royalty recipient and royalty percentage for a given tokenId. Standard interface identifier for Foundation royalties. Public function callable by anyone.

Royalties configurations are prioritized in the same way as the getRoyalties function.

Permissions: Public function callable by anyone.

getRoyalties

Gets royalty recipient and royalty percentage for a given tokenId. Public function callable by anyone.

Royalties configurations are prioritized in the following order (from highest priority to lowest):

  1. If the token is minted by an extension, and the extension implements the ICreatorExtensionRoyalties interface, the royalty for that token as defined by the extension

  2. If the token is minted by an extension, the default royalty configured on the contract for all tokens for that extension

  3. The default royalty configured for the contract for all tokens

Permissions: Public function callable by anyone.

royaltyInfo

Gets royalty configuration (receiver and royalty amount) for a given token provided tokenID and salePrice. Supports the same interface as other marketplace platforms such as Rarible or Foundation (EIP-2981 NFT Royalty Standard). Public function callable by anyone.

Royalties configurations are prioritized in the same way as the getRoyalties function.

Permissions: Public function callable by anyone.

setRoyalties

Sets default royalties for all tokens on a contract. You can also use the same function specifying a particular tokenID to set royalties for that singular token.

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

Last updated