-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpNFT.sol
33 lines (24 loc) · 1.11 KB
/
npNFT.sol
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
33
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/access/Ownable.sol";
contract npNFT is ERC721, Ownable {
string baseURI = "https://gateway.ipfs.io/ipfs/QmXxTZZhC41JB8bdLcqnCHEXq9px45uJbuN7iZ7PM8wSEP/";
constructor() ERC721("Non-private NFT", "npNFT") {
}
function updateBaseURI(string calldata newBaseURI) onlyOwner public {
baseURI = newBaseURI;
}
function _baseURI() internal view override returns (string memory) {
return baseURI;
}
function mint(address to, uint256 tokenId) onlyOwner public {
_mint(to, tokenId);
}
function batchMint(address[] calldata recipients, uint256[] calldata tokenIds) onlyOwner public {
require(recipients.length == tokenIds.length, "recipients and tokenIds arrays must have same number of entries");
for (uint256 c = 0; c < recipients.length; c++) {
_mint(recipients[c], tokenIds[c]);
}
}
}