ERC721Mock.sol 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. pragma solidity ^0.6.0;
  2. import "../token/ERC721/ERC721.sol";
  3. /**
  4. * @title ERC721Mock
  5. * This mock just provides a public safeMint, mint, and burn functions for testing purposes
  6. */
  7. contract ERC721Mock is ERC721 {
  8. constructor (string memory name, string memory symbol) public ERC721(name, symbol) { }
  9. function exists(uint256 tokenId) public view returns (bool) {
  10. return _exists(tokenId);
  11. }
  12. function tokensOfOwner(address owner) public view returns (uint256[] memory) {
  13. return _tokensOfOwner(owner);
  14. }
  15. function setTokenURI(uint256 tokenId, string memory uri) public {
  16. _setTokenURI(tokenId, uri);
  17. }
  18. function setBaseURI(string memory baseURI) public {
  19. _setBaseURI(baseURI);
  20. }
  21. function mint(address to, uint256 tokenId) public {
  22. _mint(to, tokenId);
  23. }
  24. function safeMint(address to, uint256 tokenId) public {
  25. _safeMint(to, tokenId);
  26. }
  27. function safeMint(address to, uint256 tokenId, bytes memory _data) public {
  28. _safeMint(to, tokenId, _data);
  29. }
  30. function burn(uint256 tokenId) public {
  31. _burn(tokenId);
  32. }
  33. }