ERC721Mock.sol 1.0 KB

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