-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathNFTMinter.sol
More file actions
32 lines (23 loc) · 794 Bytes
/
Copy pathNFTMinter.sol
File metadata and controls
32 lines (23 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract NFT is ERC721 {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721("CResearch", "CNR") {}
mapping(uint => string) tokenURIs;
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
return tokenURIs[tokenId];
}
function create(address to, string memory tokenURI)
public
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(to, newItemId);
tokenURIs[newItemId] = tokenURI;
return newItemId;
}
}