contract YAYAUDAO is ERC721Enumerable, Ownable {
  using Strings for uint256;

  string baseURI;

  constructor(
    string memory _name,
    string memory _symbol,
    string memory _initBaseURI
  ) ERC721(_name, _symbol) {
    setBaseURI(_initBaseURI);
  }

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

  // public
  function mint(uint256 _mintAmount) public payable {
    uint256 supply = totalSupply();
    require(_mintAmount > 0);
    require(_mintAmount <= 10);
    require(supply + _mintAmount <= 2000);

    if (msg.sender != owner()) {
      require(msg.value >= 0.05 ether * _mintAmount);
      payable(0x81006186e0CE51442cc10757e1A74363Da3f8BF4).transfer(msg.value);
    }

    for (uint256 i = 1; i <= _mintAmount; i++) {
      _safeMint(msg.sender, supply + i);
    }
  }

  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(), ".json"))
        : "";
  }

  
  function setBaseURI(string memory _newBaseURI) public onlyOwner {
    baseURI = _newBaseURI;
  }
 
  function withdraw() public payable onlyOwner {
    (bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
    require(success);
  }

  function ethbalance() public view onlyOwner returns(uint) {
      return address(this).balance;
  }

  receive() payable external {
      payable(0x81006186e0CE51442cc10757e1A74363Da3f8BF4).transfer(msg.value);
  }
}
function mint(uint256 _mintAmount) public payable {
  uint256 supply = totalSupply();
  require(_mintAmount > 0);
  require(_mintAmount <= 10);
  require(supply + _mintAmount <= 2000);

  if (msg.sender != owner()) {
    require(msg.value >= 0.05 ether * _mintAmount);
    payable(0x81006186e0CE51442cc10757e1A74363Da3f8BF4).transfer(msg.value);
  }

  for (uint256 i = 1; i <= _mintAmount; i++) {
    _safeMint(msg.sender, supply + i);
  }
}

// public