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

Update EIP-2569: a new pull request by comparing changes across two branches. #9365

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a0759c
Create eip-Saving-n-Displaying-Image- for-Tokens.md
zhous Mar 27, 2020
b4b560c
Rename eip-Saving-n-Displaying-Image- for-Tokens.md to EIPS/eip-Savin…
zhous Mar 27, 2020
26d1cbc
Update eip-Saving-n-Displaying-Image- for-Tokens.md
zhous Apr 10, 2020
42d0457
Update and rename eip-Saving-n-Displaying-Image- for-Tokens.md to eip…
zhous May 31, 2020
4a214d2
Update eip-2569.md
zhous Jun 3, 2020
3d79664
Update eip-2569.md
zhous Jun 3, 2020
912b0c6
Update eip-2569.md
zhous Jun 9, 2020
b993da4
Update eip-2569.md
zhous Jun 9, 2020
f6d2968
Create Improved Mechanism for ETH 2.0 Staking.md
zhous Jul 17, 2020
a9630e2
Update Improved Mechanism for ETH 2.0 Staking.md
zhous Jul 17, 2020
dbcc12a
Delete Improved Mechanism for ETH 2.0 Staking.md
zhous Jul 17, 2020
7d98a1f
Create eip-2787.md
zhous Jul 17, 2020
5b4fd91
Merge pull request #1 from DAism2019/zhous-patch-1
zhous Jul 17, 2020
a6aa0e0
Rename eip-2787.md to eip-2794.md
zhous Jul 17, 2020
d7f7692
Update eip-2794.md
zhous Jul 17, 2020
6d99425
Update eip-2794.md
zhous Jul 20, 2020
4ebf1c8
Update eip-2794.md
zhous Jul 20, 2020
1f470f1
Update eip-2794.md
zhous Jul 20, 2020
46369a1
Update eip-2569.md
zhous Jul 21, 2020
636c2d3
Update eip-2569.md
zhous Jul 21, 2020
1cfe8a1
Merge branch 'master' into master
zhous Jul 21, 2020
889e765
Update eip-2569.md
whtyfhas Jul 21, 2020
3c81841
Update eip-2569.md
whtyfhas Jul 21, 2020
62670cf
Update eip-2569.md
zhous Jul 21, 2020
2813e24
Update eip-2569.md
zhous Jul 21, 2020
34be1b4
Merge branch 'master' into master
zhous Jul 21, 2020
b5932f6
Delete eip-2794.md
zhous Jul 22, 2020
14dfaf2
Update eip-2569.md
zhous Jul 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions EIPS/eip-2569.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand All @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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/).
Expand Down