@@ -262,21 +262,10 @@ contract ERC721 is ERC165, IERC721 {
262
262
emit Transfer (owner, address (0 ), tokenId);
263
263
}
264
264
265
- /**
266
- * @dev Internal function to clear current approval of a given token ID
267
- * Reverts if the given address is not indeed the owner of the token
268
- * @param owner owner of the token
269
- * @param tokenId uint256 ID of the token to be transferred
270
- */
271
- function _clearApproval (address owner , uint256 tokenId ) internal {
272
- require (ownerOf (tokenId) == owner);
273
- if (_tokenApprovals[tokenId] != address (0 )) {
274
- _tokenApprovals[tokenId] = address (0 );
275
- }
276
- }
277
-
278
265
/**
279
266
* @dev Internal function to add a token ID to the list of a given address
267
+ * Note that this function is left internal to make ERC721Enumerable possible, but is not
268
+ * intended to be called by custom derived contracts: in particular, it emits no Transfer event.
280
269
* @param to address representing the new owner of the given token ID
281
270
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
282
271
*/
@@ -288,6 +277,9 @@ contract ERC721 is ERC165, IERC721 {
288
277
289
278
/**
290
279
* @dev Internal function to remove a token ID from the list of a given address
280
+ * Note that this function is left internal to make ERC721Enumerable possible, but is not
281
+ * intended to be called by custom derived contracts: in particular, it emits no Transfer event,
282
+ * and doesn't clear approvals.
291
283
* @param from address representing the previous owner of the given token ID
292
284
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
293
285
*/
@@ -322,4 +314,17 @@ contract ERC721 is ERC165, IERC721 {
322
314
msg .sender , from, tokenId, _data);
323
315
return (retval == _ERC721_RECEIVED);
324
316
}
317
+
318
+ /**
319
+ * @dev Private function to clear current approval of a given token ID
320
+ * Reverts if the given address is not indeed the owner of the token
321
+ * @param owner owner of the token
322
+ * @param tokenId uint256 ID of the token to be transferred
323
+ */
324
+ function _clearApproval (address owner , uint256 tokenId ) private {
325
+ require (ownerOf (tokenId) == owner);
326
+ if (_tokenApprovals[tokenId] != address (0 )) {
327
+ _tokenApprovals[tokenId] = address (0 );
328
+ }
329
+ }
325
330
}
0 commit comments