From 6754461619eb5e29fa5c8750d5767b4e4cbb4f98 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Sun, 28 Jan 2018 13:34:23 -0500 Subject: [PATCH] Clarify invalid deeds and counting --- EIPS/eip-721.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/EIPS/eip-721.md b/EIPS/eip-721.md index 459bcb91..f9695566 100644 --- a/EIPS/eip-721.md +++ b/EIPS/eip-721.md @@ -67,29 +67,28 @@ interface ERC721 { /// @notice Find the owner of a deed /// @param _deedId The identifier for a deed we are inspecting - /// @dev Deeds assigned to zero address are considered destroyed, and + /// @dev Deeds assigned to zero address are considered invalid, and /// queries about them do throw. /// @return The non-zero address of the owner of deed `_deedId`, or `throw` /// if deed `_deedId` is not tracked by this contract function ownerOf(uint256 _deedId) external view returns (address _owner); /// @notice Count deeds tracked by this contract - /// @return A count of the deeds tracked by this contract, where each one of - /// them has an assigned and queryable owner + /// @return A count of valid deeds tracked by this contract, where each one of + /// them has an assigned and queryable owner not equal to the zero address function countOfDeeds() external view returns (uint256 _count); /// @notice Count all deeds assigned to an owner - /// @dev Throws if `_owner` is the zero address, representing destroyed deeds. + /// @dev Throws if `_owner` is the zero address, representing invalid deeds. /// @param _owner An address where we are interested in deeds owned by them /// @return The number of deeds owned by `_owner`, possibly zero function countOfDeedsByOwner(address _owner) external view returns (uint256 _count); /// @notice Enumerate deeds assigned to an owner /// @dev Throws if `_index` >= `countOfDeedsByOwner(_owner)` or if - /// `_owner` is the zero address, representing destroyed deeds. + /// `_owner` is the zero address, representing invalid deeds. /// @param _owner An address where we are interested in deeds owned by them - /// @param _index A counter between zero and `countOfDeedsByOwner(_owner)`, - /// inclusive + /// @param _index A counter less than `countOfDeedsByOwner(_owner)` /// @return The identifier for the `_index`th deed assigned to `_owner`, /// (sort order not specified) function deedOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 _deedId); @@ -104,10 +103,10 @@ interface ERC721 { event Transfer(address indexed from, address indexed to, uint256 indexed deedId); /// @dev The Approve event emits to log the "approved taker" for a deed -- whether - /// set for the first time, reaffirmed by setting the same value, or by setting to - /// to a new value. The "approved taker" is the zero address if nobody can take the + /// set for the first time, reaffirmed by setting the same value, or setting to + /// a new value. The "approved taker" is the zero address if nobody can take the /// deed now or it is an address if that address can call `takeOwnership` to attempt - /// taking the deed. Any change to the "approved taker" for a deed SHALL cause cause + /// taking the deed. Any change to the "approved taker" for a deed SHALL cause /// Approve to emit. However, an exception, the Approve event will not emit when /// Transfer emits, this is because Transfer implicitly denotes the "approved taker" /// is reset to the zero address. @@ -118,13 +117,14 @@ interface ERC721 { /// the deed is assigned to you, only the most recent approval matters. Emits /// an Approval event. /// @dev Throws if `msg.sender` does not own deed `_deedId` or if `_to` == - /// `msg.sender`. + /// `msg.sender` or if `_deedId` is not a valid deed. /// @param _deedId The deed for which you are granting approval function approve(address _to, uint256 _deedId) external payable; /// @notice Become owner of a deed for which you are currently approved /// @dev Throws if `msg.sender` is not approved to become the owner of - /// `deedId` or if `msg.sender` currently owns `_deedId`. + /// `deedId` or if `msg.sender` currently owns `_deedId` or if `_deedId is not a + /// valid deed. /// @param _deedId The deed that is being transferred function takeOwnership(uint256 _deedId) external payable; } @@ -191,7 +191,7 @@ contract ERC721Enumerable is ERC721 { /// @notice Enumerate active deeds /// @dev Throws if `_index` >= `countOfDeeds()` - /// @param _index A counter between zero and `countOfDeeds()`, inclusive + /// @param _index A counter less than `countOfDeeds()` /// @return The identifier for the `_index`th deed, (sort order not /// specified) function deedByIndex(uint256 _index) external view returns (uint256 _deedId); @@ -202,7 +202,7 @@ contract ERC721Enumerable is ERC721 { /// @notice Enumerate owners /// @dev Throws if `_index` >= `countOfOwners()` - /// @param _index A counter between zero and `countOfOwners()`, inclusive + /// @param _index A counter less than `countOfOwners()` /// @return The address of the `_index`th owner (sort order not specified) function ownerByIndex(uint256 _index) external view returns (address _owner); } @@ -234,7 +234,7 @@ This definition is consistent with the fact that ERC-721 contracts track ownersh **Deed identifiers** -The basis of this standard is that every deed is identified by a unique 256-bit unsigned integer within its tracking contract. This ID number MUST NOT change for the life of the contract. The pair `(contract address, asset ID)` will then be a globally unique and fully-qualified identifier for a specific deed within the Ethereum ecosystem. While some contracts may find it convenient to start with ID 0 and simply increment by one for each new NFT, callers MUST NOT assume that ID numbers have any specific pattern to them, and should treat the ID as a "black box". Also note that a deeds MAY be destroyed and as such you cannot simply count from from `0` to `countOfDeeds()`. Please see the enumerations functions for a supported enumeration interface. +The basis of this standard is that every deed is identified by a unique 256-bit unsigned integer within its tracking contract. This ID number MUST NOT change for the life of the contract. The pair `(contract address, asset ID)` will then be a globally unique and fully-qualified identifier for a specific deed within the Ethereum ecosystem. While some contracts may find it convenient to start with ID 0 and simply increment by one for each new NFT, callers MUST NOT assume that ID numbers have any specific pattern to them, and should treat the ID as a "black box". Also note that a deeds MAY become invalid (be destroyed). Please see the enumerations functions for a supported enumeration interface. **Transfer mechanism**