contract DegeneratesClub is Ownable, ERC721A, ReentrancyGuard {

  constructor(
    uint256 maxBatchSize_,
    uint256 collectionSize_,
    uint256 amountForAuctionAndDev_,
    uint256 amountForDevs_
  ) ERC721A("Degenerates Club", "Degens", maxBatchSize_, collectionSize_) {
    require(amountForAuctionAndDev_ <= collectionSize_, "larger collection size needed" );
  }
    
    uint256 pricePer = 0.04 ether;
    uint256 totalCost;
    uint256 maxSupply = 5000;
    uint256 saleIsActive = 0;

    function flipSaleState(uint256 num) public onlyOwner {
        saleIsActive = num;
    }
    function setMintPrice(uint256 price) public onlyOwner {
        pricePer = price;
    }
    function maxSupplyChange(uint256 newMax) public onlyOwner {
        maxSupply = newMax;
    }

    /**
     * @dev Public sale mint
     * @param quantity Number of tokens to mint
     *
     * 
     * - Degenerates Club members cost 0.04 per mint.
     * - 10 can be minted per transaction. Gas fees are real small, if you want more just send another transaction.
     * - The contract is constructed to optimize gas.
     */
  function mint(uint256 quantity) external payable {
    require(saleIsActive == 1, 'Sale is not active');
    require(quantity <= 10, 'Cant mint more than 10');
    require(totalSupply() + quantity <= maxSupply);
    require(msg.value >= (pricePer*quantity), 'Not enough Eth sent');
    _safeMint(msg.sender, quantity);
  }

  function mintMarketing(address toPerson, uint256 quantity) external onlyOwner {
    require(saleIsActive == 1, 'Sale is not active');
    require(quantity <= 10, 'Cant mint more than 10');
    require(totalSupply() + quantity <= maxSupply);
    _safeMint(toPerson, quantity);
  }

  // // metadata URI
  string private _baseTokenURI;

  function _baseURI() internal view virtual override returns (string memory) {
    return _baseTokenURI;
  }

  function setBaseURI(string calldata baseURI) external onlyOwner {
    _baseTokenURI = baseURI;
  }

  function withdrawMoney() external onlyOwner nonReentrant {
    (bool success, ) = msg.sender.call{value: address(this).balance}("");
    require(success, "Transfer failed.");
  }

  function setOwnersExplicit(uint256 quantity) external onlyOwner nonReentrant {
    _setOwnersExplicit(quantity);
  }

  function numberMinted(address owner) public view returns (uint256) {
    return _numberMinted(owner);
  }

  function getOwnershipData(uint256 tokenId)
    external
    view
    returns (TokenOwnership memory)
  {
    return ownershipOf(tokenId);
  }
}
function mint(uint256 quantity) external payable {
  require(saleIsActive == 1, 'Sale is not active');
  require(quantity <= 10, 'Cant mint more than 10');
  require(totalSupply() + quantity <= maxSupply);
  require(msg.value >= (pricePer*quantity), 'Not enough Eth sent');
  _safeMint(msg.sender, quantity);
}

/**
 * @dev Public sale mint
 * @param quantity Number of tokens to mint
 *
 * 
 * - Degenerates Club members cost 0.04 per mint.
 * - 10 can be minted per transaction. Gas fees are real small, if you want more just send another transaction.
 * - The contract is constructed to optimize gas.
 */