-
Notifications
You must be signed in to change notification settings - Fork 564
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
Add ERC: Named NFT #320
base: master
Are you sure you want to change the base?
Add ERC: Named NFT #320
Changes from 10 commits
afbbcc8
22037ae
d4c75c9
ab5d2ff
7149bf5
825f26d
bf99a8f
060725a
d43404e
0e26902
5e815ec
5a601b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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-tbd-named-nfts-extending-erc-721/18550 | ||||||
xinbenlv marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
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` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Don't use backticks to bypass the linter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your abstract is certainly terse, but it doesn't contain enough information about what the proposal actually does. What is a named NFT? How do the names work? |
||||||
|
||||||
## 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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```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` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
<!-- TODO: inlcude `ERC-165` interface id --> | ||||||
Check warning on line 80 in ERCS/erc-7653.md GitHub Actions / EIP WalidatorHTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`
|
||||||
|
||||||
## Rationale | ||||||
|
||||||
Needs discussion | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Backwards Compatibility | ||||||
|
||||||
This ERC is designed to be backward compatible with `ERC-721` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Security Considerations | ||||||
|
||||||
Needs discussion. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Copyright | ||||||
|
||||||
Copyright and related rights waived via [CC0](../LICENSE.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description doesn't really say anything about what's in this proposal. It only says where to look for more information.
It'd be nice to see at a glance what's actually in this document.