Skip to content

Instantly share code, notes, and snippets.

@noFAYZ
Created February 28, 2022 22:23
Show Gist options
  • Save noFAYZ/1c9118a2d7fe8e3bb5e3bb6cdfbb7fb4 to your computer and use it in GitHub Desktop.
Save noFAYZ/1c9118a2d7fe8e3bb5e3bb6cdfbb7fb4 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.12+commit.f00d7308.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract finalNFT is ERC721, ERC721URIStorage, Ownable {
constructor() ERC721("Mars NFT", "MFT") {
_safeMint(msg.sender, 1);
_setTokenURI(1, "1.json");
}
function _baseURI() internal pure override returns (string memory) {
return "ipfs://QmRGFU6GxVH7GUT6eWobtStRkGqb7tKSnZ3aQeG31NrPtp/";
}
// 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