contract Les_Non_Fongible_Femmes is ERC721Enumerable, Ownable, RandomlyAssigned {
  using Strings for uint256;
  
  string public baseExtension = ".json";
  uint256 public cost = 0.03 ether;
  uint256 public maxFEMME = 500;
  uint256 public maxMintAmount = 10;
  bool public paused = false;
  
  string public baseURI = "https://ipfs.io/ipfs/QmVVGLmHfbQjpmPrk95qv7DtrBJ8ZfDVMv1iws7RJHhLCp/";

  constructor(
  ) ERC721("Les Non Fongible Femmes", "Femme")
  RandomlyAssigned(500, 1) {}

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

  // public
  function mint(uint256 _mintAmount) public payable {
    require(!paused);
    require(_mintAmount > 0);
    require(_mintAmount <= maxMintAmount);
    require(totalSupply() + _mintAmount <= maxFEMME);
    require(msg.value >= cost * _mintAmount);

    for (uint256 i = 1; i <= _mintAmount; i++) {
        uint256 mintIndex = nextToken();
     if (totalSupply() < maxFEMME) {
                _safeMint(_msgSender(), mintIndex);
    }
   }
  }

  function walletOfOwner(address _owner)
    public
    view
    returns (uint256[] memory)
  {
    uint256 ownerTokenCount = balanceOf(_owner);
    uint256[] memory tokenIds = new uint256[](ownerTokenCount);
    for (uint256 i; i < ownerTokenCount; i++) {
      tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
    }
    return tokenIds;
  }

  function tokenURI(uint256 tokenId)
    public
    view
    virtual
    override
    returns (string memory)
  {
    require(
      _exists(tokenId),
      "ERC721Metadata: URI query for nonexistent token"
    );

    string memory currentBaseURI = _baseURI();
    return bytes(currentBaseURI).length > 0
        ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
        : "";
  }

  //only owner

  function withdraw() public payable onlyOwner {
    require(payable(msg.sender).send(address(this).balance));
  }
}
// (づ｡◕‿‿◕｡)づ
// Les Non Fongible Femmes is a series of hand-painted female portraits from NonFungible Lady.
// Only 500 Les Non Fongible Femmes portraits will exist.
// Mint cost 0.03 eth per Femme, max 10 femmes per transaction, please mint directly from contract on Etherscan.
//SPDX-License-Identifier: MIT
function _baseURI() internal view virtual override returns (string memory) {
    return baseURI;
  }
// internal