Skip to content

Creating a Token

Calling setupNewTokenWithCreateReferral on a deployed 1155 contract will create a new token. In addition, by passing in your address as the createReferral will yield you rewards from those mints. All tokens start at tokenId 1 and increment up. tokenId 0 is reserved for the contract information. maxSupply should be set to MAX_INT for an open edition.

View source code here

function setupNewTokenWithCreateReferral(
    string calldata newURI,
    uint256 maxSupply,
    address createReferral
) public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_MINTER) nonReentrant returns (uint256)

Token Metadata

Each token in a Zora 1155 or 721 contract has a metadata uri field which points to a JSON Metadata file, pinned to IPFS, containing the media associated with the token as well as additional descriptive info. Refer to the SDK guide on building token metadata for schematic info, utilities, and sample code to build and pin the json and corresponding assets to IPFS.

Updating Metadata

updateTokenURI updates the token URI for a token. Won't work for tokenId 0 since that is reserved for the contract level information.

function updateTokenURI(
    uint256 tokenId, 
    string memory _newURI
)

Updates the contract metadata.

function updateContractMetadata(
    string memory _newURI, 
    string memory _newName
)