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
ERC721and following interface
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);
}- A compliant contract MUST implement the
ERC165interface
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.
