Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// SPDX-License-Identifier: MIT
pragma solidity ^ 0.8 .4;
// Made with Love by Dennison Bertram
import "@openzeppelin/contracts@4.6.0/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.6.0/access/Ownable.sol";
import "@openzeppelin/contracts@4.6.0/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC721/extensions/draft-ERC721Votes.sol";
import "@openzeppelin/contracts@4.6.0/utils/Counters.sol";
contract MyToken is ERC721, Ownable, EIP712, ERC721Votes {
using Counters
for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("MyToken", "MTK") EIP712("MyToken", "1") {}
function _baseURI() internal pure override returns(string memory) {
return "<>";
function safeMint(address to) public onlyOwner {
uint256 tokenId = _tokenIdCounter.current();
_safeMint(to, tokenId);
// The following functions are overrides required by Solidity.
function _afterTokenTransfer(address from, address to, uint256 tokenId)
override(ERC721, ERC721Votes) {
super._afterTokenTransfer(from, to, tokenId);
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
override(ERC721) {
require(from == address(0), "Err: token is SOUL BOUND");
super._beforeTokenTransfer(from, to, tokenId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment