Created
April 1, 2021 19:01
-
-
Save Sledro/eaa225c15bdd7ef7e9222b8b017e118d to your computer and use it in GitHub Desktop.
PellarNFTs
This file contains 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.7.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/token/ERC721/ERC721.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/utils/Counters.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/access/Ownable.sol"; | |
contract PellarNFTs is ERC721, Ownable { | |
using Counters for Counters.Counter; | |
Counters.Counter private _tokenIds; | |
constructor() ERC721("PellarNFTs", "PNF") {} | |
function mintNft(address receiver, string memory tokenURI) external onlyOwner returns (uint256) { | |
_tokenIds.increment(); | |
uint256 newNftTokenId = _tokenIds.current(); | |
_mint(receiver, newNftTokenId); | |
_setTokenURI(newNftTokenId, tokenURI); | |
return newNftTokenId; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment