diff --git a/ERCS/erc-7653.md b/ERCS/erc-7653.md new file mode 100644 index 0000000000..6f17c144fa --- /dev/null +++ b/ERCS/erc-7653.md @@ -0,0 +1,96 @@ +--- +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-7653-named-nfts-erc-721-extension/18550 +status: Draft +type: Standards Track +category: ERC +created: 2024-03-13 +requires: 165, 721, 7632 +--- + +## 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. + +1. A compliant contract MUST implement `ERC-721` and following interface + +```solidity +interface IERCNamedNFT { + /// @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); +} +``` + +2. A compliant contract MUST implement the `ERC-165` + + + +## Rationale + +Needs discussion + +## 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).