diff --git a/EIPS/eip-2569.md b/EIPS/eip-2569.md index d8eeb0f728bf88..8adc8e979fb055 100644 --- a/EIPS/eip-2569.md +++ b/EIPS/eip-2569.md @@ -18,9 +18,9 @@ This set of interfaces allow a smart contract to save an SVG image in Ethereum a The interface set has two interfaces: one to save an SVG file in Ethereum and the other to retrieve an SVG file from Ethereum. Typical applications include but not limited to: -A solution for storage of a fungible token's icon. -A solution for storage of a non-fungible token's icon. -A solution for storage of the icon/logo of a DAO's reputation token. +* A solution for storage of a fungible token's icon. +* A solution for storage of a non-fungible token's icon. +* A solution for storage of the icon/logo of a DAO's reputation token. ## Motivation The ERC-721 token standard is a popular standard to define a non-fungible token in Ethereum. This standard is widely used to specify a crypto gift, crypto medal, crypto collectible etc. The most famous use case is the [cryptokitty](https://www.cryptokitties.co/). @@ -34,6 +34,7 @@ Although this is an applicable way to display an image for a token, the image is Hence we propose a set of interfaces to save an image for a universal token in Ethereum to keep the image permanent and tamper-resistant, and to retrieve an image for a universal token from Ethereum. ## Specification + An EIP-2569 compatible contract MUST have a method with the signature getTokenImageSvg(uint256) view returns (string memory) and a method with the signature setTokenImageSvg(uint256 tokenId, string memory imagesvg) internal. These methods define how a smart contract saves an image for a universal token in Ethereum which keeps the image permanent and tamper-resistant, and how a smart contract retrieves an image from Ethereum for a universal token. @@ -47,7 +48,6 @@ It has the following parameter: tokenId: for a non-fungible token such as an ERC-721 token or a multi-token such as an ERC-1155 token which has a member "ID" to specify its token type or token index our proposed interface assigns an SVG image's file content to a string variable of the token's contract and associates the SVG image to this "ID" number. This unique ID is used to access its SVG image in both a "set" operation and a "get" operation. For a fungible token such as an ERC-20 token no such an ID is needed and our proposed interface just assigns an SVG image's file content to a string variable of the token's contract. - * setTokenImageSvg(uint256 tokenId, string memory imagesvg) internal: for an ERC-721 or ERC-1155 token or a token implemented by a contract which has a member "ID" to specify its token type or token index we define an interface to associate an SVG image to the token's ID number. For an ERC-20 token or a token implemented by a contract which doesn't have a member "ID" to specify its token type or token index we define an interface to assign an SVG image to a member variable string of this token's contract. It has the following two parameters: @@ -95,18 +95,18 @@ There are no backward compatibility issues. [DeMe](https://www.deme.app/) ## Implementation -```tokenId```: a token index in an ERC-721 token or a token type/index in an ERC-1155 token. It is a uint256 variable. +`tokenId`: a token index in an ERC-721 token or a token type/index in an ERC-1155 token. It is a uint256 variable. -```imageSvg```: an SVG image's file content. It is a string variable. Note: the SVG image should include at least three attributes:"name", "description" and "issuer". +`imageSvg`: an SVG image's file content. It is a string variable. Note: the SVG image should include at least three attributes:"name", "description" and "issuer". -```setTokenImageSvg```: interface to set an SVG image to a token with or without an ID number. +`setTokenImageSvg`: interface to set an SVG image to a token with or without an ID number. -```getTokenImageSvg```: interface to get an SVG image for a token with or without an ID number. +`getTokenImageSvg`: interface to get an SVG image for a token with or without an ID number. We propose to add three sol files in the existing ERC-721 implementation. Here are the details for the proposed sol files. -``` +```solidity // ----- IERC721GetImageSvg.sol ------------------------- pragma solidity ^0.5.0; @@ -357,7 +357,7 @@ _tokenImageSvg = svgCode ## Articles & Discussions -[Image Storage Solution Based on Ethereum Sharding,2019](https://naturaldao.io/en/collaboration/blog/65-storage-shading.html) +[Image Storage Solution Based on Ethereum Sharding](https://naturaldao.io/en/collaboration/blog/65-storage-shading.html) ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).