From afbbcc8e37ac26e78b25273a55712a8e880aa66e Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 10:31:34 -0700 Subject: [PATCH 01/11] Create draft-erc-named-erc721 --- draft-erc-named-erc721 | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 draft-erc-named-erc721 diff --git a/draft-erc-named-erc721 b/draft-erc-named-erc721 new file mode 100644 index 0000000000..2979564fdc --- /dev/null +++ b/draft-erc-named-erc721 @@ -0,0 +1,47 @@ +--- +title: Named ERC-721 (NFT) tokens +description: An extension to ERC-721 based on ERC-7632. +author: Zainan Victor Zhou +discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 +status: Draft +type: Standards Trac +category: ERC +created: 2024-03-13 +requires: 7632, 721, 165 +--- + +## Abstract + +An extension to `ERC-721` based on `ERC-7632` to enable named ERC-721 + +## Motivation + + +## Specification + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. + +A compliant contract MUST implement `ERC-721` and following interface + +```solidity +interface IERC_draft { + +function trasfer +} +``` + +## Rationale + +TBD + +## Backwards Compatibility + +This ERC is designed to be backward compatible with ERC-721 + +## Security Considerations + +Needs discussion. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From 22037ae687bfd1178d887cfb4ba78c5e77f48555 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 10:32:09 -0700 Subject: [PATCH 02/11] Update draft-erc-named-erc721 --- draft-erc-named-erc721 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-erc-named-erc721 b/draft-erc-named-erc721 index 2979564fdc..ddc5f2e176 100644 --- a/draft-erc-named-erc721 +++ b/draft-erc-named-erc721 @@ -1,5 +1,5 @@ --- -title: Named ERC-721 (NFT) tokens +title: Named NFT description: An extension to ERC-721 based on ERC-7632. author: Zainan Victor Zhou discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 From d4c75c9cdaf16b07611dded2abadbb53612d410d Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 11:03:43 -0700 Subject: [PATCH 03/11] Update draft-erc-named-erc721 --- draft-erc-named-erc721 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/draft-erc-named-erc721 b/draft-erc-named-erc721 index ddc5f2e176..df0c807345 100644 --- a/draft-erc-named-erc721 +++ b/draft-erc-named-erc721 @@ -21,18 +21,23 @@ An extension to `ERC-721` based on `ERC-7632` to enable named ERC-721 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. -A compliant contract MUST implement `ERC-721` and following interface +1. A compliant contract MUST implement `ERC-721` and following interface ```solidity -interface IERC_draft { - -function trasfer +interface IERCNamedNFT { + function safeTransferFromByName(string memory _tokenName, address from, address to, bytes calldata); + function approveByName(address _approved, string memory _tokenName) external payable; + function getApprovedByName(string memory _tokenName) external view returns (address); } ``` +2. A compliant contract MUST implement the ERC-165 + +<-- TODO: inlcude ERC-165 interface id --> + ## Rationale -TBD +Needs discussion ## Backwards Compatibility From ab5d2ffc768af87a59fb52ebdbfa06dbf70206f3 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:03:17 -0700 Subject: [PATCH 04/11] Update draft-erc-named-erc721 --- draft-erc-named-erc721 | 49 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/draft-erc-named-erc721 b/draft-erc-named-erc721 index df0c807345..090b4d1dbe 100644 --- a/draft-erc-named-erc721 +++ b/draft-erc-named-erc721 @@ -25,9 +25,52 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S ```solidity interface IERCNamedNFT { - function safeTransferFromByName(string memory _tokenName, address from, address to, bytes calldata); - function approveByName(address _approved, string memory _tokenName) external payable; - function getApprovedByName(string memory _tokenName) external view returns (address); + /// @notice Find the owner of an NFT + /// @dev NFTs assigned to zero address are considered invalid, and queries + /// about them do throw. + /// @param _tokenName The name for an NFT + /// @return The address of the owner of the NFT + function ownerOfByName(string memory _tokenName) external view returns (address); + + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenName The NFT to transfer + /// @param data Additional data with no specified format, sent in call to `_to` + function safeTransferFromByName(address _from, address _to, string memory _tokenName, bytes data) external payable; + + /// @notice Transfers the ownership of an NFT from one address to another address + /// @dev This works identically to the other function with an extra data parameter, + /// except this function just sets data to "". + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenId The NFT to transfer + function safeTransferFromByName(address _from, address _to, string memory _tokenName) external payable; + + /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE + /// THEY MAY BE PERMANENTLY LOST + /// @dev Throws unless `msg.sender` is the current owner, an authorized + /// operator, or the approved address for this NFT. Throws if `_from` is + /// not the current owner. Throws if `_to` is the zero address. Throws if + /// `_tokenId` is not a valid NFT. + /// @param _from The current owner of the NFT + /// @param _to The new owner + /// @param _tokenId The NFT to transfer + function transferFromByName(address _from, address _to, string memory _tokenName) external payable; + + /// @notice Change or reaffirm the approved address for an NFT + /// @dev The zero address indicates there is no approved address. + /// Throws unless `msg.sender` is the current NFT owner, or an authorized + /// operator of the current owner. + /// @param _approved The new approved NFT controller + /// @param _tokenId The NFT to approve + function approveByName(address _approved, string memory _tokenName) external payable; + + /// @notice Get the approved address for a single NFT + /// @dev Throws if `_tokenId` is not a valid NFT. + /// @param _tokenId The NFT to find the approved address for + /// @return The approved address for this NFT, or the zero address if there is none + function getApprovedByName(string memory _tokenName) external view returns (address); } ``` From 7149bf515a7dd50d83f2d172e182739906cdcb51 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:04:01 -0700 Subject: [PATCH 05/11] Rename draft-erc-named-erc721 to erc-7653..d --- draft-erc-named-erc721 => erc-7653..d | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename draft-erc-named-erc721 => erc-7653..d (100%) diff --git a/draft-erc-named-erc721 b/erc-7653..d similarity index 100% rename from draft-erc-named-erc721 rename to erc-7653..d From 825f26d1be1113fb5abff710f179c2a4ba7e2596 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:04:13 -0700 Subject: [PATCH 06/11] Rename erc-7653..d to erc-7653.md --- erc-7653..d => erc-7653.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename erc-7653..d => erc-7653.md (100%) diff --git a/erc-7653..d b/erc-7653.md similarity index 100% rename from erc-7653..d rename to erc-7653.md From bf99a8f8fa84eeb57ff651f57897addb137a6053 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:05:23 -0700 Subject: [PATCH 07/11] Rename erc-7653.md to ERCS/erc-7653.md --- erc-7653.md => ERCS/erc-7653.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename erc-7653.md => ERCS/erc-7653.md (100%) diff --git a/erc-7653.md b/ERCS/erc-7653.md similarity index 100% rename from erc-7653.md rename to ERCS/erc-7653.md From 060725a040b26560be2cb05804733b47e7d8901d Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:07:03 -0700 Subject: [PATCH 08/11] Update erc-7653.md --- ERCS/erc-7653.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ERCS/erc-7653.md b/ERCS/erc-7653.md index 090b4d1dbe..3bc58e868c 100644 --- a/ERCS/erc-7653.md +++ b/ERCS/erc-7653.md @@ -1,18 +1,18 @@ --- title: Named NFT description: An extension to ERC-721 based on ERC-7632. -author: Zainan Victor Zhou +author: Zainan Victor Zhou <@xinbenlv> discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 status: Draft type: Standards Trac category: ERC created: 2024-03-13 -requires: 7632, 721, 165 +requires: 165, 721, 7632 --- ## Abstract -An extension to `ERC-721` based on `ERC-7632` to enable named ERC-721 +An extension to `ERC-721` based on `ERC-7632` to enable named `ERC-721` ## Motivation From d43404e26a79b58adf028989139a8d86878b8cb8 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:10:10 -0700 Subject: [PATCH 09/11] Update erc-7653.md --- ERCS/erc-7653.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ERCS/erc-7653.md b/ERCS/erc-7653.md index 3bc58e868c..506c9dd3e7 100644 --- a/ERCS/erc-7653.md +++ b/ERCS/erc-7653.md @@ -1,7 +1,8 @@ --- +eip: 7653 title: Named NFT description: An extension to ERC-721 based on ERC-7632. -author: Zainan Victor Zhou <@xinbenlv> +author: Zainan Victor Zhou (@xinbenlv) discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 status: Draft type: Standards Trac @@ -74,7 +75,7 @@ interface IERCNamedNFT { } ``` -2. A compliant contract MUST implement the ERC-165 +2. A compliant contract MUST implement the `ERC-165` <-- TODO: inlcude ERC-165 interface id --> @@ -84,7 +85,7 @@ Needs discussion ## Backwards Compatibility -This ERC is designed to be backward compatible with ERC-721 +This ERC is designed to be backward compatible with `ERC-721` ## Security Considerations From 0e269027a751be1680960f7b28d6245c7ca5626b Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Wed, 13 Mar 2024 12:14:01 -0700 Subject: [PATCH 10/11] Update erc-7653.md --- ERCS/erc-7653.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-7653.md b/ERCS/erc-7653.md index 506c9dd3e7..9f24d74a3d 100644 --- a/ERCS/erc-7653.md +++ b/ERCS/erc-7653.md @@ -5,7 +5,7 @@ description: An extension to ERC-721 based on ERC-7632. author: Zainan Victor Zhou (@xinbenlv) discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 status: Draft -type: Standards Trac +type: Standards Track category: ERC created: 2024-03-13 requires: 165, 721, 7632 @@ -77,7 +77,7 @@ interface IERCNamedNFT { 2. A compliant contract MUST implement the `ERC-165` -<-- TODO: inlcude ERC-165 interface id --> + ## Rationale From 5a601b5598723eececdf5874cc2cabd211e0ad73 Mon Sep 17 00:00:00 2001 From: xinbenlv Date: Fri, 15 Mar 2024 12:17:57 -0700 Subject: [PATCH 11/11] Update ERCS/erc-7653.md Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com> --- ERCS/erc-7653.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-7653.md b/ERCS/erc-7653.md index 9f24d74a3d..6f17c144fa 100644 --- a/ERCS/erc-7653.md +++ b/ERCS/erc-7653.md @@ -3,7 +3,7 @@ eip: 7653 title: Named NFT description: An extension to ERC-721 based on ERC-7632. author: Zainan Victor Zhou (@xinbenlv) -discussions-to: https://ethereum-magicians.org/t/erc-tbd-named-nfts-extending-erc-721/18550 +discussions-to: https://ethereum-magicians.org/t/erc-7653-named-nfts-erc-721-extension/18550 status: Draft type: Standards Track category: ERC