Deploy an NFT Token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ExampleNFT is ERC721, Ownable {
uint256 private _tokenIdCounter;
constructor() ERC721("ExampleNFT", "ENFT") {
_tokenIdCounter = 0;
}
function mint(address to) external onlyOwner {
_mint(to, _tokenIdCounter);
_tokenIdCounter++;
}
function totalSupply() public view returns (uint256) {
return _tokenIdCounter;
}
}
