Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
ERC721URITokenJSON
copy icon
DirtyCajunRice
• version 1.0.0
ERC721
Token
Upgradeable
TokenURI
Metadata

ERC721URITokenJSON

Upgradeable ERC721 Extension for on-chain metadata (Paired with TokenMetadata)

*Visit desktop site to download or deploy

Version

1.0.0

Last Publish

12/12/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
__ERC721URITokenJSON_init() :
This function is used to initialize the ERC721URIToken contract. It sets the contract's name, symbol, and base URI. It also sets the total supply of tokens to 0. This function is only called once when the contract is deployed. (autogenerated documentation)
tokenURI(uint256) :
This function is used to return the tokenURI of a given tokenId. It works by calling the tokenURIJSON function, which returns a JSON object containing the tokenURI, and then converting that JSON object into a base64 string. The tokenURI is a string that contains information about the token, such as its name, description, and other metadata. (autogenerated documentation)
tokenURIJSON(uint256) :
This function is used to retrieve the token URI for a given token ID. It takes an array of token IDs as an input and returns an array of token URIs. It works by looping through the array of token IDs and retrieving the token URI for each one, then storing it in the array of token URIs that is returned. (autogenerated documentation)
batchTokenURI(uint256[]) :
This function is used to retrieve the tokenURI of multiple tokenIds at once. It takes an array of tokenIds as an input and returns an array of tokenURIs. It does this by looping through the array of tokenIds and calling the tokenURI function for each tokenId, storing the result in the uris array. (autogenerated documentation)
batchTokenURIJSON(uint256[]) :
This function takes an array of token IDs as an input and returns an array of strings containing the token URI JSON for each token ID. It does this by looping through the array of token IDs and calling the tokenURIJSON() function for each one, storing the result in the array of strings. (autogenerated documentation)
makeMetadataJSON(uint256,string,string) :
This function creates a JSON string containing metadata about a given ERC721 token. It takes in the token ID, a name, a description, and an array of attributes as parameters. It then uses the ownerOf() function to get the address of the owner of the token, and creates an imageURI string using the imageBaseURI and imageURISuffix() functions. Finally, it calls the makeMetadataJSON() function from the TokenMetadata contract to create the JSON string, passing in the token ID, owner address, name, imageURI, description, token type, and attributes as parameters. (autogenerated documentation)
imageURISuffix(uint256) :
This function is used to generate a unique image URI suffix for a given token ID. It takes a uint256 tokenId as an input and returns a string memory containing the tokenId as a string. This allows the tokenId to be used as a unique identifier for the image URI. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i ERC721URITokenJSON
copy icon

Last Publish

12/12/2022

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.