contract Kevinmon is ERC721A, Ownable {

    string public baseURI = "";
    string public contractURI = "";
    string public constant baseExtension = ".json";
    address public constant proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;

    uint256 public constant MAX_PER_TX = 10;
    uint256 public constant MAX_SUPPLY = 6666;
    uint256 public constant price = 0.0069 ether;

    bool public paused = true;

    constructor() ERC721A("Kevinmon", "KEVIN") {}

    /**
     * @notice Mint a Kevinmon for 0.0069 each (Max 10 per transaction - 0.069)
     *
     * @dev Mints Kevinmon NFT
     *
     * @param  _amount         The amount of Kevinmons to mint
     *
     */
    function mint(uint256 _amount) external payable {
        address _caller = _msgSender();
        require(!paused, "Paused");
        require(MAX_SUPPLY >= totalSupply() + _amount, "Exceeds max supply");
        require(_amount > 0, "No 0 mints");

        require(MAX_PER_TX >= _amount , "Excess max per paid tx");
        require(_amount * price == msg.value, "Invalid funds provided");

        _safeMint(_caller, _amount);
    }

    function isApprovedForAll(address owner, address operator)
        override
        public
        view
        returns (bool)
    {
        // Whitelist OpenSea proxy contract for easy trading.
        ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress);
        if (address(proxyRegistry.proxies(owner)) == operator) {
            return true;
        }

        return super.isApprovedForAll(owner, operator);
    }

    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;
        (bool success, ) = _msgSender().call{value: balance}("");
        require(success, "Failed to send");
    }

    function setupOS() external onlyOwner {
        _safeMint(_msgSender(), 1);
    }

    function pause(bool _state) external onlyOwner {
        paused = _state;
    }

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

    function setContractURI(string memory _contractURI) external onlyOwner {
        contractURI = _contractURI;
    }

    function tokenURI(uint256 _tokenId) public view override returns (string memory) {
        require(_exists(_tokenId), "Token does not exist.");
        return bytes(baseURI).length > 0 ? string(
            abi.encodePacked(
              baseURI,
              Strings.toString(_tokenId),
              baseExtension
            )
        ) : "";
    }
}
function mint(uint256 _amount) external payable {
    address _caller = _msgSender();
    require(!paused, "Paused");
    require(MAX_SUPPLY >= totalSupply() + _amount, "Exceeds max supply");
    require(_amount > 0, "No 0 mints");

    require(MAX_PER_TX >= _amount , "Excess max per paid tx");
    require(_amount * price == msg.value, "Invalid funds provided");

    _safeMint(_caller, _amount);
}

/**
 * @notice Mint a Kevinmon for 0.0069 each (Max 10 per transaction - 0.069)
 *
 * @dev Mints Kevinmon NFT
 *
 * @param  _amount         The amount of Kevinmons to mint
 *
 */