contract Fund4Ukraine is ERC1155Supply, Ownable {
    using ECDSA for bytes32;

    // Contract name
    string public name = "Fund4Ukraine";
    // Contract symbol
    string public symbol = "F4UA";

    bool public pauseTokenOne = false;
    uint256 public constant TOKEN_ID_ONE = 1;
    uint256 public constant TOKEN_ONE_PRICE = 0.05 ether;
    address public DonationAddress = 0x165CD37b4C644C2921454429E7F9358d18A45e14;


    // Used to ensure each new token id can only be minted once by the owner
    mapping (uint256 => string) public tokenURI;

    constructor(
        string memory uriBase,
        string memory uriTokenOne
    ) ERC1155(uriBase) {
        tokenURI[TOKEN_ID_ONE] = uriTokenOne;
    }

    /**
     * Returns the custom URI for each token id. Overrides the default ERC-1155 single URI.
     */
    function uri(uint256 tokenId) public view override returns (string memory) {
        // If no URI exists for the specific id requested, fallback to the default ERC-1155 URI.
        if (bytes(tokenURI[tokenId]).length == 0) {
            return super.uri(tokenId);
        }
        return tokenURI[tokenId];
    }

    /**
     * Sets a URI for a specific token id.
     */
    function setURI(string memory _newTokenURI, uint256 tokenId) public onlyOwner {
        tokenURI[tokenId] = _newTokenURI;
    }

    function setPauseStateOne(bool _pause) public onlyOwner {
        pauseTokenOne = _pause;
    }

    function mint(uint256 numberOfTokens, uint256 tokenId) external payable {
        require(tokenId > 0, "TokenId must be more than zero");
        require(tokenId < 2, "TokenId must be less than 2");
        require(numberOfTokens > 0, "Must mint at least one token");
        if (tokenId == 1) {
            require(!pauseTokenOne, "Token One sale is not active");
            require(TOKEN_ONE_PRICE * numberOfTokens == msg.value, "Incorrect Price");
        }
        _mint(msg.sender, tokenId, numberOfTokens, "");
    }

    /**
     * @notice Override ERC1155 such that zero amount token transfers are disallowed to prevent arbitrary creation of new tokens in the collection.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public override {
        require(amount > 0, "Amount cant be zero");
        return super.safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @notice When the contract is paused, all token transfers are prevented in case of emergency.
     */

    function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
        internal
        override
    {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    function withdraw() external onlyOwner {
        require(address(this).balance > 0, "Balance is zero");
        payable(DonationAddress).transfer(address(this).balance);
    }
}
function setURI(string memory _newTokenURI, uint256 tokenId) public onlyOwner {
    tokenURI[tokenId] = _newTokenURI;
}

/**
 * Sets a URI for a specific token id.
 */