Hello, I started learning programming, what features of this smart contract are needed to make a simple NFT that can mint several items together.
It is preferable to use the least and best features...
Features:
What is each one of these for?
- Mintable
- Auto Increment Ids
- Burnable
- Pausable
- Votes
- Enumerable
- URI Storage
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyNFT is ERC721 {
constructor() ERC721("MyNFT", "NFT") {}
}
And is this function correct? Is there a better and cheaper way on ERC721? ( not ERC721A, ... )
function mint(uint num) public payable
{
uint256 supply = totalSupply();
require(Minting, "Sale must be active to mint tokens");
require(supply + num <= Maximum, "Purchase would exceed max tokens");
require(Price * num <= msg.value, "Ether value sent is not correct");
for (uint256 i = 0; i < num; i++)
{
_safeMint(msg.sender, supply + i);
}
}