Appearance
Solidity API
PropsMetadataTokenBasedInternal
Internal contract for managing token-based metadata
This contract provides internal functions for handling token metadata, including URI generation and storage
_uri
solidity
function _uri(uint256 _tokenId) internal view returns (string)Retrieves the URI for a given token ID
If the metadata is stored as IPFS CID, it returns the IPFS URI. Otherwise, it returns a base64 encoded data URI
Parameters
| Name | Type | Description |
|---|---|---|
| _tokenId | uint256 | The ID of the token to retrieve the URI for |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | string | A string containing the URI for the token metadata |
_setTokenMetadata
solidity
function _setTokenMetadata(uint256 _tokenId, string _metadata) internalSets the metadata for a specific token
This function updates the metadata associated with a given token ID
Parameters
| Name | Type | Description |
|---|---|---|
| _tokenId | uint256 | The ID of the token to set the metadata for |
| _metadata | string | The metadata string to associate with the token |