// @title NFT Utility description
/// Note: the EIP-165 identifier for this interface is ed231d73
interfaceIERC6785{// Logged when the utility description URL of an NFT is changed
/// @notice Emitted when the utilityURL of an NFT is changed
/// The empty string for `utilityUri` indicates that there is no utility associated
eventUpdateUtility(uint256indexedtokenId,stringutilityUri);/// @notice set the new utilityUri - remember the date it was set on
/// @dev The empty string indicates there is no utility
/// Throws if `tokenId` is not valid NFT
/// @param utilityUri The new utility description of the NFT
/// 4a048176
functionsetUtilityUri(uint256tokenId,stringutilityUri)external;/// @notice Get the utilityUri of an NFT
/// @dev The empty string for `utilityUri` indicates that there is no utility associated
/// @param tokenId The NFT to get the user address for
/// @return The utility uri for this NFT
/// 5e470cbc
functionutilityUriOf(uint256tokenId)externalviewreturns(stringmemory);/// @notice Get the changes made to utilityUri
/// @param tokenId The NFT to get the user address for
/// @return The history of changes to `utilityUri` for this NFT
/// f96090b9
functionutilityHistoryOf(uint256tokenId)externalviewreturns(string[]memory);}
所有定义为 view 的函数 MAY 被实现为 pure 或 view
函数 setUtilityUri MAY 被实现为 public 或 external。此外,设置 utilityUri 的能力 SHOULD 仅限于提供 utility 的人,无论是 NFT 创建者还是其他人。
utilityHistoryOf 方法 MUST 反映对 tokenId 的 utilityUri 所做的所有更改,无论这些更改是通过 setUtilityUri 完成的,还是通过任何其他方式(例如批量更新)完成的。
当使用 ed231d73 调用时,supportsInterface 方法 MUST 返回 true
原始元数据 SHOULD 符合 “ERC-6785 Metadata with utilities JSON Schema”,它是 ERC-721 中定义的 “ERC-721 Metadata JSON Schema” 的兼容扩展。
“ERC-6785 Metadata with utilities JSON Schema” :
{"title":"Asset Metadata","type":"object","properties":{"name":{"type":"string","description":"Identifies the asset to which this NFT represents"},"description":{"type":"string","description":"Describes the asset to which this NFT represents"},"image":{"type":"string","description":"A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."},"utilities":{"type":"object","required":["type","description","t&c"],"properties":{"type":{"type":"string","description":"Describes what type of utility this is"},"description":{"type":"string","description":"A brief description of the utility"},"properties":{"type":"array","description":"An array of possible properties describing the utility, defined as key-value pairs","items":{"type":"object"}},"expiry":{"type":"number","description":"The period of time for the validity of the utility, since the minting of the NFT. Expressed in seconds"},"t&c":{"type":"string","description":""}}}}}
{"name":"...","description":"...","image":"...","utilities":{"type":"Video call","description":"I will enter a private video call with whoever owns the NFT","properties":[{"sessions":2},{"duration":30},{"time_unit":"minutes"}],"expiry":1.577e+7,"t&c":"https://...."}}