contract MWCBones is ERC721Enum, Ownable, ReentrancyGuard {
	using Strings for uint256;
	string public baseURI;
	//sale settings
	uint256 public cost = 0.0015 ether;
	uint256 public maxSupply = 4999;
	uint256 public maxMint = 10;
	bool public status = true;

	constructor(
	string memory _name,
	string memory _symbol,
	string memory _initBaseURI
	) ERC721(_name, _symbol){
	setBaseURI(_initBaseURI);
	}
	// internal
	function _baseURI() internal view virtual returns (string memory) {
	return baseURI;
	}
	// public minting
	function mint(uint256 _mintAmount) public payable nonReentrant{
	uint256 s = totalSupply();
	require(status, "Off" );
	require(_mintAmount > 0, "0" );
	require(_mintAmount <= maxMint, "Too many" );
	require(s + _mintAmount <= maxSupply, "Max" );
	require(msg.value >= cost * _mintAmount);
	for (uint256 i = 0; i < _mintAmount; ++i) {
	_safeMint(msg.sender, s + i, "");
	}
	delete s;
	}
	// admin minting
  	function adminMint(address[] calldata recipient) external onlyOwner{
	uint256 s = totalSupply();
	require(s + recipient.length <= maxSupply, "Too many" );
	for(uint i = 0; i < recipient.length; ++i){
	_safeMint(recipient[i], s++, "" );
	}
	delete s;	
	}
	function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
	require(_exists(tokenId), "ERC721Metadata: Nonexistent token");
	string memory currentBaseURI = _baseURI();
	return bytes(currentBaseURI).length > 0	? string(abi.encodePacked(currentBaseURI, tokenId.toString())) : "";
	}
	function setCost(uint256 _newCost) public onlyOwner {
	cost = _newCost;
	}
	function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner {
	maxMint = _newMaxMintAmount;
	}
	function setBaseURI(string memory _newBaseURI) public onlyOwner {
	baseURI = _newBaseURI;
	}
    function setmaxSupply(uint256 _newMaxSupply) public onlyOwner {
	maxSupply = _newMaxSupply;
	}
	function setSaleStatus(bool _status) public onlyOwner {
	status = _status;
	}
	function withdraw() public onlyOwner {
	(bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
    require(success);
	}
}
function adminMint(address[] calldata recipient) external onlyOwner{
	uint256 s = totalSupply();
	require(s + recipient.length <= maxSupply, "Too many" );
	for(uint i = 0; i < recipient.length; ++i){
	_safeMint(recipient[i], s++, "" );
	}
	delete s;	
	}
// admin minting