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

    string public PROVENANCE = "";
    uint256 public publicPrice = 150000000000000000; //0.15 ETH
    bool public saleIsActive = true;

    constructor() ERC721("bLootRock (not for Weaks)", "bLootRock (not for Weaks)") {
    }

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

    function deposit() public payable onlyOwner {}

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


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

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

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


    //Public sale minting
    function mint(uint lootId) public payable nonReentrant {
        require(saleIsActive, "Sale must be active to mint");
        require(publicPrice <= msg.value, "Ether value sent is not correct");
        require(lootId > 0 && lootId < 101, "Token ID invalid");
        require(!_exists(lootId), "This token has already been minted");

        _safeMint(msg.sender, lootId);
    }
    function multiMint(uint[] memory lootIds) public payable nonReentrant {
        require(saleIsActive, "Sale must be active to mint");
        require((publicPrice * lootIds.length) <= msg.value, "Ether value sent is not correct");
        
        for (uint i=0; i<lootIds.length; i++) {
            require(lootIds[i] > 0 && lootIds[i] < 101, "Token ID invalid");
            require(!_exists(lootIds[i]), "One of these tokens have already been minted");
            _safeMint(msg.sender, lootIds[i]);
        }
        
    }
}
/**
 * @title LootRock contract
 * @dev Extends ERC721 Non-Fungible Token Standard basic implementation
 */
function mint(uint lootId) public payable nonReentrant {
        require(saleIsActive, "Sale must be active to mint");
        require(publicPrice <= msg.value, "Ether value sent is not correct");
        require(lootId > 0 && lootId < 101, "Token ID invalid");
        require(!_exists(lootId), "This token has already been minted");

        _safeMint(msg.sender, lootId);
    }
//Public sale minting