contract Soltars is ERC721Burnable, Ownable {
    
    string public SOLTARS_PROVENANCE = "";

    uint256 public VANGUARDS_PRICE = 0.08 ether;
    uint256 public WARRIORS_PRICE = 0.06 ether;
    
    uint256 public GENERALS_MINTED;

    bool private DISABLEd_GENERAL_MINT;
    
    bool public IS_VANGUARDS_MINT_ACTIVE;
    bool public IS_WARRIORS_MINT_ACTIVE;

    address payable private dev = payable(0xC9d050C0176bE46Fc54c711Fc80B1f2aaA717F07);
    address payable private sol = payable(0x6Ec18D9D13D123beB9d84CFdD4418c751351CE72);

    constructor()ERC721("Soltars", "SOLTARS") {
    }

    function withdraw() external onlyOwner {
        uint balance = address(this).balance;
        dev.transfer((balance*15)/100);
        sol.transfer((balance*85)/100);
    }

    /*     
    * Set provenance once it's calculated
    */
    function setProvenanceHash(string memory provenanceHash) external onlyOwner {
        SOLTARS_PROVENANCE = provenanceHash;
    }

    function setSolAddress(address payable wallet) external onlyOwner {
        sol = wallet;
    }

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

    function flipVanguardsMintState() external onlyOwner {
        IS_VANGUARDS_MINT_ACTIVE = !IS_VANGUARDS_MINT_ACTIVE;
    }

    function flipWarriorsMintState() external onlyOwner {
        IS_WARRIORS_MINT_ACTIVE = !IS_WARRIORS_MINT_ACTIVE;
    }

    function disableGeneralMint() external onlyOwner {
        DISABLEd_GENERAL_MINT = true;
    }

    /**
    * Mints 3000 Vanguards
    */
    function mintVanguards(uint256 numberOfTokens) external payable {
        require(IS_VANGUARDS_MINT_ACTIVE, "Vanguards Mint is Not Active");
        require(numberOfTokens <= 5, "Max 5 Vanguards Per Transaction are allowed");
        require((totalSupply()+numberOfTokens) <= 3000, "Vanguards Mint Finished");
        require(msg.value == (numberOfTokens * VANGUARDS_PRICE), "Wrong Eth value sent");
        
        for(uint i = 0; i < numberOfTokens; i++) {
            uint mintIndex = totalSupply();
            _safeMint(msg.sender, mintIndex);
        }
    }

    /**
    * Mints 7000 Warriors
    */
    function mintWarriors(uint256 numberOfTokens) external payable {
        require(IS_WARRIORS_MINT_ACTIVE, "Warriors Mint is Not Active");
        require((totalSupply()+numberOfTokens) <= 10000, "Warriors Mint Finished");
        require(msg.value == (numberOfTokens * WARRIORS_PRICE), "Wrong Eth value sent");
        
        for(uint i = 0; i < numberOfTokens; i++) {
            uint mintIndex = totalSupply();
            _safeMint(msg.sender, mintIndex);
        }
    }

    /**
    * Mints 15 Generals
    */
    function mintGenerals(uint256 numberOfTokens) external onlyOwner {
        require(!DISABLEd_GENERAL_MINT, "Generals Mint Finished");

        GENERALS_MINTED += numberOfTokens;
        
        for(uint i = 0; i < numberOfTokens; i++) {
            uint mintIndex = totalSupply();
            _safeMint(msg.sender, mintIndex);
        }
    }
}
function mintVanguards(uint256 numberOfTokens) external payable {
    require(IS_VANGUARDS_MINT_ACTIVE, "Vanguards Mint is Not Active");
    require(numberOfTokens <= 5, "Max 5 Vanguards Per Transaction are allowed");
    require((totalSupply()+numberOfTokens) <= 3000, "Vanguards Mint Finished");
    require(msg.value == (numberOfTokens * VANGUARDS_PRICE), "Wrong Eth value sent");
        
    for(uint i = 0; i < numberOfTokens; i++) {
        uint mintIndex = totalSupply();
        _safeMint(msg.sender, mintIndex);
    }
}

/**
 * Mints 3000 Vanguards
 */