Skip to content

Commit e847ffe

Browse files
authored
Use a better magic value, clarify callback, thanks @abandeali1
1 parent 1eeddf7 commit e847ffe

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

EIPS/eip-721.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,19 @@ interface ERC721 /* is ERC165 */ {
9595
/// @dev Throws unless `msg.sender` is the current owner, an authorized
9696
/// operator, or the approved address for this NFT. Throws if `_from` is
9797
/// not the current owner. Throws if `_to` is the zero address. Throws if
98-
/// `_tokenId` is not a valid NFT. When transfer is complete, this function also
99-
/// calls `onNFTReceived` on `_to` and throws if the return value is not
100-
/// `keccak256("ERC721_ONNFTRECEIVED")`.
98+
/// `_tokenId` is not a valid NFT. When transfer is complete, this function
99+
/// checks if `_to` is a smart contract (code size > 0). If so, it calls
100+
/// `onNFTReceived` on `_to` and throws if the return value is not
101+
/// `bytes4(keccak256("onNFTReceived(address,uint256,bytes)"))`.
101102
/// @param _from The current owner of the NFT
102103
/// @param _to The new owner
103104
/// @param _tokenId The NFT to transfer
104105
/// @param data Additional data with no specified format, sent in call to `_to`
105106
function transferFrom(address _from, address _to, uint256 _tokenId, bytes[] data) external payable;
106107
107108
/// @notice Transfers the ownership of an NFT from one address to another address
108-
/// @dev Throws unless `msg.sender` is the current owner, an authorized
109-
/// operator, or the approved address for this NFT. Throws if `_from` is
110-
/// not the current owner. Throws if `_to` is the zero address. Throws if
111-
/// `_tokenId` is not a valid NFT. When transfer is complete, this function also
112-
/// calls `onNFTReceived` on `_to` and throws if the return value is not
113-
/// `keccak256("ERC721_ONNFTRECEIVED")`.
109+
/// @dev This works identically to the other function with an extra data parameter,
110+
/// except this function just sets data to []
114111
/// @param _from The current owner of the NFT
115112
/// @param _to The new owner
116113
/// @param _tokenId The NFT to transfer

0 commit comments

Comments
 (0)