Skip to content

Commit

Permalink
Merge pull request #543 from nfttakerun/feature/subscriptionnft
Browse files Browse the repository at this point in the history
subscriptionNFT
  • Loading branch information
yu23ki14 authored Mar 17, 2024
2 parents 99ffef1 + 47a36d9 commit bd1e8f3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions hardhat/contracts/SubscriptionNFT.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

contract SubscriptionNFT is
Initializable,
ERC721EnumerableUpgradeable,
OwnableUpgradeable
{
uint256 private _tokenIds;

function initialize() public initializer {
__ERC721_init("SubscriptionNFT", "SNFT");
__ERC721URIStorage_init();
__Ownable_init();
}

function mintNFT(address recipient, string memory tokenURI)
public onlyOwner
returns (uint256)
{
_tokenIds++;

uint256 newItemId = _tokenIds;
_mint(recipient, newItemId);
_setTokenURI(newItemId, tokenURI);

return newItemId;
}

}

0 comments on commit bd1e8f3

Please sign in to comment.