diff --git a/EIPS/eip-7160.md b/EIPS/eip-7160.md index 3d4e6d9bb1e28..eb404e70895e1 100644 --- a/EIPS/eip-7160.md +++ b/EIPS/eip-7160.md @@ -1,7 +1,7 @@ --- eip: 7160 title: ERC-721 Multi-Metadata Extension -description: "This EIP proposes an extension to the ERC-721 to support multiple metadata URIs per token." +description: "Multiple metadata URIs per token, with the option to pin a primary URI." author: 0xG (@0xGh), Marco Peyfuss (@mpeyfuss) discussions-to: https://ethereum-magicians.org/t/erc721-multi-metadata-extension/14629 status: Draft @@ -19,12 +19,14 @@ This EIP proposes an extension to the [ERC-721](./eip-721.md) standard to suppor The current [ERC-721](./eip-721.md) standard allows for a single metadata URI per token. However, there are use cases where multiple metadata URIs are desirable, such as when a token represents a collection of (cycling) assets with individual metadata, historic token metadata, collaborative and multi-artist tokens, evolving tokens. This extension enables such use cases by introducing the concept of multi-metadata support. +The primary reason for having a multi-metadata standard versus existing `tokenURI` with some token-specific functions to change the active URI is that dapps and marketplaces don't have a mechanism to infer and display all the URIs in a carousel, gallery, list, etc. The non-pinned URIs might be equally important: imagine a colaborative token with multiple artworks per token. + ## Specification -The `IERC721MultiMetadata` interface extends the existing `IERC721` interface and introduces additional methods and events: +The `IERC721MultiMetadata` interface: ```solidity -interface IERC721MultiMetadata is IERC721 { +interface IERC721MultiMetadata /* is IERC721 */ { event TokenUriPinned(uint256 indexed tokenId, uint256 indexed index, address indexed sender); event TokenUriUnpinned(uint256 indexed tokenId, address indexed sender); @@ -68,13 +70,13 @@ This extension is designed to be backward compatible with existing [ERC-721](./e An open-source reference implementation of the `IERC721MultiMetadata` interface can be provided, demonstrating how to extend an existing [ERC-721](./eip-721.md) contract to support multi-metadata functionality. This reference implementation can serve as a guide for developers looking to implement the extension in their own contracts. ```solidity -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.19; -import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/interfaces/IERC4906.sol"; +import "./token/ERC721/ERC721.sol"; +import "./access/Ownable.sol"; +import "./interfaces/IERC4906.sol"; import "./IERC721MultiMetadata.sol"; contract MultiMetadata is Ownable, ERC721, IERC721MultiMetadata, IERC4906 { @@ -160,4 +162,4 @@ This extension does not poses new security risks outside of those that might ari ## Copyright -This work is licensed under the MIT License. +Copyright and related rights waived via [CC0](../LICENSE.md).