Make overide of ERC721.isApprovedForAll affect the ERC721 logic (#2597)

pull/2599/head
Hadrien Croubois 4 years ago committed by GitHub
parent 7c1625b0e0
commit 3dc374ddcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      contracts/token/ERC721/ERC721.sol

@ -113,7 +113,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
@ -216,7 +216,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender));
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**

Loading…
Cancel
Save