From 1d613bab257aaa1c8013aaed54c5e608c53cad3b Mon Sep 17 00:00:00 2001 From: William Entriken Date: Fri, 16 Feb 2018 14:18:18 -0500 Subject: [PATCH] Specify functions that cannot throw --- EIPS/eip-721.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-721.md b/EIPS/eip-721.md index 015e31cc..cb8882c7 100644 --- a/EIPS/eip-721.md +++ b/EIPS/eip-721.md @@ -77,6 +77,7 @@ interface ERC721 /* is ERC165 */ { /// @notice Count all deeds assigned to an owner /// @dev Throws if `_owner` is the zero address, representing invalid deeds. + /// Otherwise this function must not throw. /// @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); @@ -84,6 +85,7 @@ interface ERC721 /* is ERC165 */ { /// @notice Enumerate deeds assigned to an owner /// @dev Throws if `_index` >= `countOfDeedsByOwner(_owner)` or if /// `_owner` is the zero address, representing invalid deeds. + /// Otherwise this must not throw. /// @param _owner An address where we are interested in deeds owned by them /// @param _index A counter less than `countOfDeedsByOwner(_owner)` /// @return The identifier for the `_index`th deed assigned to `_owner`, @@ -194,18 +196,21 @@ interface ERC721Enumerable { // this.ownerByIndex.selector; /// @notice Enumerate active deeds - /// @dev Throws if `_index` >= `countOfDeeds()` + /// @dev Throws if `_index` >= `countOfDeeds()`. + /// Otherwise must not throw. /// @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); /// @notice Count of owners which own at least one deed + /// Must not throw. /// @return A count of the number of owners which own deeds function countOfOwners() external view returns (uint256 _count); /// @notice Enumerate owners /// @dev Throws if `_index` >= `countOfOwners()` + /// Otherwise must not throw. /// @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); @@ -215,7 +220,7 @@ interface ERC721Enumerable { Here is a also an optional **ERC-721 Operators Extension** for delegating access to your deeds. This is copied from the ERC-777 efforts. At this time DO NOT recommend this extension because of [a security considuration](https://github.com/ethereum/EIPs/issues/777#issuecomment-366182824) but we are putting it forth as a starting point for discussion. ```solidity -/// WARNING: THIS INTERFACE IS TO PROMOTO DISCUSSION, WE DO NOT RECOMMEND YOU +/// WARNING: THIS INTERFACE IS TO PROMOTE DISCUSSION, WE DO NOT RECOMMEND YOU /// IMPLEMENT IT YET AS THERE ARE SECURITY CONSIDERATIONS /// @title Delegated operator extension to ERC-721 interface /// @author William Entriken (https://phor.net)