Last active
February 2, 2023 11:31
-
-
Save bartubozkurt/6f68ba8bc3a3214c41b6cce9e2cf0917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity =0.4.22; | |
/* Bad */ | |
contract BadERC721Token{ | |
function ownerOf(uint256 _tokenId) external view returns (bool); | |
//... | |
} | |
/* Better */ | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/SafeERC721.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/IERC721.sol"; | |
contract GoodERC721Token { | |
using SafeERC721 for IERC721; | |
IERC721 public _token; | |
function ownerOf(uint256 _tokenId) view returns (bool) { | |
return _token.ownerOf(_tokenId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment