LogoLogo
Manifold for Developers
Manifold for Developers
  • Introduction
  • Shopify Merch Bridge
    • Overview
    • Tutorial
      • Step 1: Product Gate Setup
        • 1.1: Configure the Product
        • 1.2: Install Manifold Merch Bridge
        • 1.2: Create a New Product Gate
        • 1.3: Link a Product to the Gate
        • 1.4: Add Rules
      • Step 2: Store Theme Setup
        • 2.1 The Theme Editor
        • 2.2 Product Page Setup
        • 2.3 Cart Page Setup
    • Advanced Configuration
    • FAQ / Error Help
    • Reference
      • Product and Gate Configuration
        • Shopify Products
        • Product Gates
          • Gate Products
          • Rules
      • Custom Themes
      • Updating to the Latest Version
      • UI Configuration Options
      • Advanced Usage
      • Common Issues
  • Guides
    • Getting Started
    • HTML
    • React
    • NextJS
    • Vue
    • Wix
    • Squarespace
      • Simple Squarespace Site
      • Customised Squarespace Template
  • Resources
    • Apps
      • Grant Types
    • Widgets
      • Directory
      • Manifold CSS Variables
        • Scheme Utility Classes
        • List of Manifold CSS Variables
      • Connect Widget
        • Blockchain Interaction
        • Wallet Authentication
        • Data Client
          • NFT Information Retrieval
            • getNFT
            • getNFTsOfOwner
            • ownerHasNFT
            • getCollectors
          • Data Storage and Retrieval
        • Advanced Configuration
        • Customization & Styling
        • Automatic Error Handling
      • Campaign Widget
        • Campaign Creation
          • Questionnaire
        • Campaign Progress
        • Customization & Styling
      • Curation Widget
      • Marketplace Widgets
        • Widgets
          • Data Attributes
          • Layout Widgets
          • Card Widgets
          • Listing Widgets
        • Window Events
        • Troubleshooting
        • Customization & Styling
        • Version Change Notes
          • 3.2.1 - CSS Selector Changes
          • 3.1.1 - CSS Selector Changes
      • Claim Widgets
        • Widgets
          • Data Attributes
          • Complete Claim Widget
          • Buy Button Only Widget
          • Mint Count Widget
        • Troubleshooting
        • Customization & Styling
        • Version Change Notes
          • 1.7.0, 1.7.1 - CSS Selector Changes
      • Restricted Token Widget
        • Customization & Styling
      • Wallet Identity Widget
        • Customization & Styling
      • Subscription Widget
      • 6551 Display Widget
    • Manifold Ethereum Provider
  • Tools and APIs
    • Merkle Tree Tool
    • Snapshot Tool
    • Discord Tools
    • Server-Side Session Authentication
      • Signature Grant
      • Authorization Code Grant
  • Smart Contracts
    • Manifold Creator
      • Contracts
        • Creator Core
          • Common Functions
          • ERC721 Functions
          • ERC1155 Functions
        • Extensions
          • Extensions Functions
          • Extensions Examples
          • Extensions Deployment Guide
            • Dynamic NFT Extension
            • Lazy Mint Extension ERC1155
            • Lazy Mint Extension ERC721
        • Mint Permissions
          • Mint Permissions Functions
      • Prior Versions
        • 1.0.x
          • Creator Core
            • Common Functions
            • ERC721 Functions
            • ERC1155 Functions
          • Extensions
            • Extensions Functions
            • Extensions Examples
            • Extensions Deployment Guide
              • Dynamic NFT Extension
              • Lazy Mint Extension ERC1155
              • Lazy Mint Extension ERC721
          • Mint Permissions
            • Mint Permissions Functions
        • 2.0.x
          • Creator Core
            • Common Functions
            • ERC721 Functions
            • ERC1155 Functions
          • Extensions
            • Extensions Functions
            • Extensions Examples
            • Extensions Deployment Guide
              • Dynamic NFT Extension
              • Lazy Mint Extension ERC1155
              • Lazy Mint Extension ERC721
          • Mint Permissions
            • Mint Permissions Functions
    • Marketplace
      • Identity Verifier
    • Royalty Registry
  • Contact Us
Powered by GitBook
On this page
  • Implementations
  • Administrative Functions
  • Token Owner Functions
  • Metadata Functions
  • Royalty Functions

Was this helpful?

  1. Smart Contracts
  2. Manifold Creator
  3. Contracts
  4. Creator Core

Common Functions

Last updated 10 months ago

Was this helpful?

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 .

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.

function revokeAdmin(address admin)
isAdmin

Admin lookup via wallet address.

Permissions: Public function callable by anyone.

function isAdmin(address admin) view returns (bool)
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

function transferOwnership(address newOwner)
setApproveTransfer
  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

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

function burn(address account, uint256[] memory tokenIds, uint256[] memory amounts)
safeTransferFrom

Permissions: Public function callable by token owner only

Input Parameters: from address, to address, tokenId

function safeTransferFrom(address _from, address _to, uint256 _tokenId)

Metadata Functions

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.

function setBaseTokenURI(string calldata uri)
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.

function setTokenURIPrefix(string calldata prefix)
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.

function setTokenURI(uint256 tokenId, string calldata uri)

function setTokenURI(uint256[] memory tokenIds, string[] calldata uris)

Royalty Functions

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

getFeeRecipients

Permissions: Public function callable by anyone.

function getFeeRecipients(uint256 id) public view
    returns (address payable[] memory)
getFeeBps

Permissions: Public function callable by anyone.

function getFeeBps(uint256 id) public view
    returns (uint[] memory)
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 function.

Permissions: Public function callable by anyone.

function getFees(unit256) public view
    returns (address[], unit256[])
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):

Permissions: Public function callable by anyone.

function getRoyalties(uint256 tokenId) view
    returns (address payable[] memory, uint256[] memory)
royaltyInfo

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

Permissions: Public function callable by anyone.

function royaltyInfo(uint256 tokenId, uint256 value) view
    returns (address, uint256)
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.

function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints)

function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints)

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

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

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 , which implies that it knows how to handle ERC721 tokens (unlike the standard transferFrom function).

When implementing transfers within your contracts its best practice to always use the safeTransferFrom function (rather than transferFrom) to ensure events set to trigger upon retrieval are successful (ensures receiver knows how to handle the tokens it is about to receive as an or Receiver).

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 . This JSON is often hosted on decentralized protocols like , like we use within Manifold Studio.

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

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

The contract's

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

If the token is minted by an extension, the on the contract for all tokens for that extension

The for the contract for all tokens

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 (). Public function callable by anyone.

CreatorCore.sol
ERC721CreatorCore.sol
ERC1155CreatorCore.sol
ERC721Creator.sol
ERC1155Creator.sol
AdminControl.sol
OpenSea Operator Filter Registry
IERC721Receiver
IERC721
ERC1155
ERC721 Metadata JSON Schema
Arweave
Rarible royalties
Rarible royalties
EIP-2981 NFT Royalty Standard
defined royalty for the specific token id
default royalty configured
IERC721CreatorExtensionApproveTransfer
IERC1155CreatorExtensionApproveTransfer
ICreatorExtensionRoyalties
default royalty configured