ERC721FullMock.sol 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. pragma solidity ^0.6.0;
  2. import "../token/ERC721/ERC721Full.sol";
  3. import "../token/ERC721/ERC721Burnable.sol";
  4. /**
  5. * @title ERC721FullMock
  6. * This mock just provides public functions for setting metadata URI, getting all tokens of an owner,
  7. * checking token existence, removal of a token from an address
  8. */
  9. contract ERC721FullMock is ERC721Full, ERC721Burnable {
  10. constructor (string memory name, string memory symbol) public ERC721Full(name, symbol) { }
  11. function exists(uint256 tokenId) public view returns (bool) {
  12. return _exists(tokenId);
  13. }
  14. function tokensOfOwner(address owner) public view returns (uint256[] memory) {
  15. return _tokensOfOwner(owner);
  16. }
  17. function setTokenURI(uint256 tokenId, string memory uri) public {
  18. _setTokenURI(tokenId, uri);
  19. }
  20. function setBaseURI(string memory baseURI) public {
  21. _setBaseURI(baseURI);
  22. }
  23. function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Full) {
  24. super._beforeTokenTransfer(from, to, tokenId);
  25. }
  26. function mint(address to, uint256 tokenId) public {
  27. _mint(to, tokenId);
  28. }
  29. }