Skip to content

Instantly share code, notes, and snippets.

@KBPsystem777
Created September 30, 2022 14:49
Show Gist options
  • Save KBPsystem777/ed6b399980f2b2a9f18dff6a1b2111e7 to your computer and use it in GitHub Desktop.
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=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.7.3/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts@4.7.3/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts@4.7.3/access/Ownable.sol";
import "@openzeppelin/contracts@4.7.3/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