interfaceIERC5334{// Logged when the user of a NFT, expires, or level is changed
/// @notice Emitted when the `user` of an NFT or the `expires` of the `user` is changed or the user `level` is changed
/// @notice 当 NFT 的 `user`、`expires` 或 `level` 更改时触发
/// The zero address for user indicates that there is no user address
/// @dev 用户的零地址表示没有用户地址
eventUpdateUser(uint256indexedtokenId,addressindexeduser,uint64expires,uint8level);/// @notice set the user and expires and level of a NFT
/// @notice 设置 NFT 的用户、过期时间 (expires) 和级别 (level)
/// @dev The zero address indicates there is no user
/// @dev 零地址表示没有用户
/// Throws if `tokenId` is not valid NFT
/// @dev 如果 `tokenId` 不是有效的 NFT 则抛出
/// @param user The new user of the NFT
/// @param user NFT 的新用户
/// @param expires UNIX timestamp, The new user could use the NFT before expires
/// @param expires UNIX 时间戳,新用户可以在过期时间之前使用 NFT
/// @param level user level
/// @param level 用户级别
functionsetUser(uint256tokenId,addressuser,uint64expires,uint8level)external;/// @notice Get the user address of an NFT
/// @notice 获取 NFT 的用户地址
/// @dev The zero address indicates that there is no user or the user is expired
/// @dev 零地址表示没有用户或用户已过期
/// @param tokenId The NFT to get the user address for
/// @param tokenId 要获取用户地址的 NFT
/// @return The user address for this NFT
/// @return 此 NFT 的用户地址
functionuserOf(uint256tokenId)externalviewreturns(address);/// @notice Get the user expires of an NFT
/// @notice 获取 NFT 的用户过期时间
/// @dev The zero value indicates that there is no user
/// @dev 零值表示没有用户
/// @param tokenId The NFT to get the user expires for
/// @param tokenId 要获取用户过期时间的 NFT
/// @return The user expires for this NFT
/// @return 此 NFT 的用户过期时间
functionuserExpires(uint256tokenId)externalviewreturns(uint256);/// @notice Get the user level of an NFT
/// @notice 获取 NFT 的用户级别
/// @dev The zero value indicates that there is no user
/// @dev 零值表示没有用户
/// @param tokenId The NFT to get the user level for
/// @param tokenId 要获取用户级别的 NFT
/// @return The user level for this NFT
/// @return 此 NFT 的用户级别
functionuserLevel(uint256tokenId)externalviewreturns(uint256);}
userOf(uint256 tokenId) 函数可以实现为 pure 或 view。
userExpires(uint256 tokenId) 函数可以实现为 pure 或 view。
userLevel(uint256 tokenId) 函数可以实现为 pure 或 view。
setUser(uint256 tokenId, address user, uint64 expires) 函数可以实现为 public 或 external。