Skip to content

Instantly share code, notes, and snippets.

@Sledro
Created April 1, 2021 19:01
Show Gist options
  • Save Sledro/eaa225c15bdd7ef7e9222b8b017e118d to your computer and use it in GitHub Desktop.
Save Sledro/eaa225c15bdd7ef7e9222b8b017e118d to your computer and use it in GitHub Desktop.
PellarNFTs
// 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