Saving and Displaying Image Onchain for Universal Tokens#2569
Saving and Displaying Image Onchain for Universal Tokens#2569MicahZoltu merged 11 commits intoethereum:masterfrom
Conversation
…g-n-Displaying-Image- for-Tokens.md
|
Welcome to the Ethereum Magicians forum to join the discussion: |
|
Here shows "Some checks haven’t completed yet". Anybody could tell me how to complete the expected check? |
Fixed some wrong typing.
Fixed two wrong typing.
Fixed a wrong typing.
Fixed "type" from Standard Track to Standards Track.
|
Here's an application based EIP-2569: www.DHonor.io |
|
Here's an application based EIP-2569: www.DHonor.io |
|
I don't know why this EIP has not been accepted after several pulls. Please give us a help if you know the reason. Here's an application based EIP-2569: www.DHonor.io |
| 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. |
There was a problem hiding this comment.
These will render as one paragraph. If you want a bulleted list you need:
| 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. |
| 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. | ||
|
|
||
| ## Definitions | ||
| ```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. |
There was a problem hiding this comment.
Use single backticks around inline code:
`tokenId`: for a non-fungible...
| We propose to add three sol files in the existing ERC-721 implementation. | ||
| Here are the details for the proposed sol files. | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Solidity syntax highlighting will be added to the renderer soon, this will tell the renderer to render using Solidity syntax highlighting.
| ``` | |
| ```solidity |
| Our proposed interfaces 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. | ||
|
|
||
| By calling our proposed interfaces we assume users are accessing an SVG image. |
There was a problem hiding this comment.
When authoring an ERC, write it as a specification rather than a suggestion of a specification. Instead of saying "Our proposed interfaces define..." say something like "An EIP-2569 compatible contract MUST have a method with the signature getTokenImageSvg(uint256) view returns (string memory)" or similar.
| Step 1: for a token such as an ERC-721 or ERC-1155 token which has a member variable "ID" to specify a token type or index and a member variable string to keep an (SVG) image associated with the "ID", retrieve the (SVG) image from Ethereum by calling our proposed "get" interface with the token's ID; | ||
| for a token which doesn't have a member variable "ID" to specify a token type of index but has a member variable string to keep an (SVG) image, retrieve the (SVG) image from Ethereum by calling our proposed "get" without an "ID". |
There was a problem hiding this comment.
Consider defining the interface in the specification section as a Solidity interface, and include notes on any required behavior of the functions.
There was a problem hiding this comment.
I am not sure if I get your point. Would you please elaborate this a little bit? Did you mean I move the " setTokenImageSvg: for an ERC-721 .....getTokenImageSvg: for an ERC-721 ......" from the "Definitions" section to here , after "Step 2:......" and before "Step 1: for a token......" ?
There was a problem hiding this comment.
A good specification may look something like this:
Implementations of this standard MUST implement the following interface:
interface Erc2569 {
function getTokenImageSvg(uint256 id) returns (string memory);
function setTokenImageSvg(string data) returns (uint256 id);
}If you pass the id returned by setTokenImageSvg into getTokenImageSvg then getTokenImageSvg MUST return the same value that setTokenImageSvg was provided.
There was a problem hiding this comment.
I got your point after I reviewed EIP-1. Changes made and committed
MicahZoltu
left a comment
There was a problem hiding this comment.
I left some initial feedback, and before being merged as final some changes should be made to this EIP. However, everything that is necessary for a draft merge is here so this is good to merge.
|
|
||
| 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. | ||
|
|
||
| ## Definitions |
There was a problem hiding this comment.
This seems to be not in line with the sections set out by EIP-1. Perhaps EIP-1 should be improved?
There was a problem hiding this comment.
Ah, good catch. This should be a subsection of Specification rather than its own section.
There was a problem hiding this comment.
I got your point after I reviewed EIP-1. I made a relatively big change by merging the original "definition" section to the "specification" section. Changes made and committed.
A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens. It's an important ERC.
A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens. It's an important ERC.
A set of interfaces to save an SVG image in Ethereum, and to retrieve the image file from Ethereum for universal tokens.
It's an important ERC.