Skip to content

Instantly share code, notes, and snippets.

@DubovinaDj
Last active October 27, 2021 09:39
Show Gist options
  • Save DubovinaDj/51f6d47f161deb1b63aaa5f6dce059f4 to your computer and use it in GitHub Desktop.
Save DubovinaDj/51f6d47f161deb1b63aaa5f6dce059f4 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract DonateAndTakeNFT is ERC721, Ownable {
uint256 public tokenCounter;
constructor() ERC721("Gift NTF", "DNTF") {}
function mint(address to)
public returns (uint256)
{
uint256 newItemId = tokenCounter;
tokenCounter = tokenCounter + 1;
_mint(to, newItemId);
return newItemId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment