Appearance
Solidity API
IPropsMetadataTokenBased
Interface for managing token-based metadata
This interface provides functions to set and retrieve metadata for individual tokens
TokenMetadataUpdated
solidity
event TokenMetadataUpdated(uint256 tokenId, string metadata)Emitted when a token's metadata is updated
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token whose metadata was updated |
| metadata | string | The new metadata string for the token |
uri
solidity
function uri(uint256 tokenId) external view returns (string)Retrieves the metadata URI for a specific token
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token to query |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | string | A string containing the metadata URI for the specified token |
setTokenMetadata
solidity
function setTokenMetadata(uint256 tokenId, string _metadata) externalSets the metadata for a specific token
This function should emit a TokenMetadataUpdated event
Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The ID of the token to update |
| _metadata | string | The new metadata string to set for the token |