From e7719ded561aa33359484d3c5b934098f6c4c521 Mon Sep 17 00:00:00 2001 From: Jeff <33238297+lamothe-hub@users.noreply.github.com> Date: Wed, 30 Mar 2022 10:34:17 -0500 Subject: [PATCH] Match IERC721 function order with EIP spec (#3287) --- contracts/token/ERC721/IERC721.sol | 56 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index fc58b032b..9a313867d 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -38,6 +38,26 @@ interface IERC721 is IERC165 { */ function ownerOf(uint256 tokenId) external view returns (address owner); + /** + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; + /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. @@ -93,15 +113,6 @@ interface IERC721 is IERC165 { */ function approve(address to, uint256 tokenId) external; - /** - * @dev Returns the account approved for `tokenId` token. - * - * Requirements: - * - * - `tokenId` must exist. - */ - function getApproved(uint256 tokenId) external view returns (address operator); - /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. @@ -115,29 +126,18 @@ interface IERC721 is IERC165 { function setApprovalForAll(address operator, bool _approved) external; /** - * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. + * @dev Returns the account approved for `tokenId` token. * - * See {setApprovalForAll} + * Requirements: + * + * - `tokenId` must exist. */ - function isApprovedForAll(address owner, address operator) external view returns (bool); + function getApproved(uint256 tokenId) external view returns (address operator); /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * - * Emits a {Transfer} event. + * See {setApprovalForAll} */ - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes calldata data - ) external; + function isApprovedForAll(address owner, address operator) external view returns (bool); }