Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ERC721 metadata #147

Open
leoloco opened this issue Mar 4, 2024 · 0 comments
Open

Implement ERC721 metadata #147

leoloco opened this issue Mar 4, 2024 · 0 comments

Comments

@leoloco
Copy link
Contributor

leoloco commented Mar 4, 2024

Context

The current NFT standard as developed in this repo only implements the interface defined in the EIP 721 https://eips.ethereum.org/EIPS/eip-721

Since the definition of this interface, the community has developed various extensions that extend the functionalities of NFT.
One of the most commonly used extension is the metadata extension: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/IERC721Metadata.sol

It allows one to associate every token with a URI that contains the metadata of the corresponding NFT.

User Flow

As an NFT creator (minter), I want to be able to assign metadata to each NFT I create, so that each token can have distinct characteristics, images, or attributes defined in a JSON file hosted at a URI. This metadata enhances the uniqueness and collectibility of each NFT.

  • As a creator, when I mint an NFT, I should be able to specify a metadata URI that points to a JSON file conforming to the ERC721 Metadata JSON Schema.
  • As a collector, when I query an NFT's details, I expect to retrieve its metadata URI and be able to view the associated metadata (such as image, description, attributes) by accessing this URI.

Technical Details

  • Implement NFT-metadata-internals

    • Create a datastructure to store URI
    • Create a method to set URI _setURI(uint256 tokenId, string URI)
    • Create a method to get URI _tokenURI(uint256 tokenId) returns (string);
  • Implement an NFT-metadata-example
    Create an example implementation of a NFT-metadata

@leoloco leoloco changed the title Implement ERC721 metadata internals Implement ERC721 metadata Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant