contract UKRAINENFTS is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable {
    using Counters for Counters.Counter;

    Counters.Counter private _tokenIdCounter;
    
    //Price in Eth or Matic, depending on Network
    uint256 public constant ethPrice = 10000000000000000; //0.01 ETH per NFT
    uint256 public constant maticPrice = 10000000000000000000; //10.0 MATIC per NFT

    constructor() ERC721("MINT FOR UKRAINE", "MUA") {}

    // ANYONE Can Call MINT.  
    // _numberOfNFTs = how many nfts to mint
    // the NFT Metadata URI
    // Payable - Total Cost for all NFTs
    // 
    function safeMint(uint32 _numberOfNFTs, string memory uri) public payable {
        
      require(msg.value >= ethPrice * _numberOfNFTs , "insufficient funds for qty requested");
      require(_numberOfNFTs > 0, "need to mint at least 1 nft");

      for(uint i = 0; i < _numberOfNFTs; i++) {

        uint256 tokenId = _tokenIdCounter.current();
        _tokenIdCounter.increment();
        _safeMint(msg.sender, tokenId);
        _setTokenURI(tokenId, uri);

      }

    }

    // The following functions are overrides required by Solidity.

    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
        super._burn(tokenId);
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
 
 
  /*
      anyone can / someone periodically needs to invoke the withdraw function, 
      balance of ETH/MATIC goes directly to Ukraine Govt Eth Address
  */
  function withdraw() public {
      uint balance = address(this).balance;
      payable(0x165CD37b4C644C2921454429E7F9358d18A45e14).transfer(balance);
      //VERIFIED UKRAINE ADDRESS
      //https://twitter.com/Ukraine/status/1497594592438497282
      //ETH and USDT (ERC-20) - 0x165CD37b4C644C2921454429E7F9358d18A45e14
  }

}
function withdraw() public {
    uint balance = address(this).balance;
    payable(0x165CD37b4C644C2921454429E7F9358d18A45e14).transfer(balance);
    //VERIFIED UKRAINE ADDRESS
    //https://twitter.com/Ukraine/status/1497594592438497282
    //ETH and USDT (ERC-20) - 0x165CD37b4C644C2921454429E7F9358d18A45e14
}

/*
 anyone can / someone periodically needs to invoke the withdraw function,
 balance of ETH/MATIC goes directly to Ukraine Govt Eth Address
 */