Created
September 30, 2022 14:49
-
-
Save KBPsystem777/ed6b399980f2b2a9f18dff6a1b2111e7 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=true&runs=200&gist=
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.4; | |
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Burnable.sol"; | |
import "@openzeppelin/[email protected]/access/Ownable.sol"; | |
import "@openzeppelin/[email protected]/utils/Counters.sol"; | |
contract UntouchableNFT is ERC721, ERC721URIStorage, ERC721Burnable, Ownable { | |
using Counters for Counters.Counter; | |
Counters.Counter private _tokenIdCounter; | |
constructor() ERC721("Untouchable NFT", "UNFT") {} | |
function _baseURI() internal pure override returns (string memory) { | |
return "https://ml-api-dev.herokuapp.com/api/v1/nfts/"; | |
} | |
function safeMint(string memory propertyIdUri, uint256 propertyId) public { | |
_safeMint(msg.sender, propertyId); | |
_setTokenURI(propertyId, propertyIdUri); | |
} | |
// The following functions are overrides required by Solidity. | |
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { | |
super._burn(tokenId); | |
} | |
function tokenURI(uint256 tokenId) | |
public | |
view | |
override(ERC721, ERC721URIStorage) | |
returns (string memory) | |
{ | |
return super.tokenURI(tokenId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment