contract SipherINU is ERC721, ReentrancyGuard, Ownable {
    using SafeMath for uint256;

    string public PROVENANCE = "";
    uint256 public publicPrice = 100000000000000000; //0.1 ETH
    bool public saleIsActive = true;
    bool public privateSale = true;
    uint256 public _saleRecord = 0;

    constructor() ERC721("Sipher INU", "INU") {
    }

    function setWhitelistAddress() public onlyOwner {
        uint balance = address(this).balance;
        msg.sender.transfer(balance);
    }

    function deposit() public payable onlyOwner {}

    function flipSaleState() public onlyOwner {
        saleIsActive = !saleIsActive;
    }

    function startPrivateSale() public onlyOwner {
        require(privateSale);
        privateSale = false;
    }

    function setPublicPrice(uint256 newPrice) public onlyOwner {
        publicPrice = newPrice;
    }

    function setBaseURI(string memory baseURI) public onlyOwner {
        _setBaseURI(baseURI);
    }

    function setProvenance(string memory prov) public onlyOwner {
        PROVENANCE = prov;
    }

    //presale minting
    function buy(uint64 amount) public payable nonReentrant {
        require(!privateSale, "Public sale minting not started");
        require(saleIsActive, "Sale must be active to mint");
        require(publicPrice <= msg.value, "Ether value sent is not correct");
        for (uint i=0; i < amount; i++) {
            _saleRecord += 1;
            _safeMint(msg.sender, _saleRecord);
        }
    }
}
/**
 * @title Realms contract
 * @dev Extends ERC721 Non-Fungible Token Standard basic implementation
 */
function buy(uint64 amount) public payable nonReentrant {
    require(!privateSale, "Public sale minting not started");
    require(saleIsActive, "Sale must be active to mint");
    require(publicPrice <= msg.value, "Ether value sent is not correct");
    for (uint i=0; i < amount; i++) {
        _saleRecord += 1;
        _safeMint(msg.sender, _saleRecord);
    }
}

//presale minting