contract DirtyPunkinz is ERC721 {
    address private _owner = 0x0f2AB8200DF18244ce81D44Bf619f4aB0671d3a6;
    uint256 public tokenCounter;
    bool public saleStatus = false;
    bool public metaLOCK = true; //if true, metadata is still changable
    address payable wallet = 0x0f2AB8200DF18244ce81D44Bf619f4aB0671d3a6;
    constructor () public ERC721 ("Dirty Punkinz", "PKIN"){
        tokenCounter = 1;
    }

    function mintPunkin() public payable{
        require(saleStatus);
        require(msg.value == 10000000000000000);
        require(tokenCounter<667);
        _safeMint(msg.sender, tokenCounter);
        tokenCounter = tokenCounter + 1;
    }

    function mintthreePunkinz() public payable{
        require(saleStatus);
        require(msg.value == 20000000000000000);
        require(tokenCounter<664);
        _safeMint(msg.sender, tokenCounter);
        tokenCounter = tokenCounter + 1;
        _safeMint(msg.sender, tokenCounter);
        tokenCounter = tokenCounter + 1;
        _safeMint(msg.sender, tokenCounter);
        tokenCounter = tokenCounter + 1;
    }

    function ownermintPunkin() public payable{
        require(msg.sender == wallet);
        require(tokenCounter<667);
        _safeMint(msg.sender, tokenCounter);
        tokenCounter = tokenCounter + 1;
    }

    function ownermintpunkintoWallet(address addr) public {
        require(msg.sender == wallet);
        require(tokenCounter<667);
        _safeMint(addr, tokenCounter);
        tokenCounter = tokenCounter + 1;
    }

    function changeBaseURI(string memory newURI) public {
        require(msg.sender == wallet);
        require(metaLOCK);
        _setBaseURI(newURI);
    }

    function startSale() public {
        require(msg.sender == wallet);
        saleStatus = true;
    }

    function stopSale() public {
        require(msg.sender == wallet);
        saleStatus = false;
    }

    function lockmeta() public {
        require(msg.sender == wallet);
        metaLOCK = false;
    }

    function getBalance() public view returns (uint256) {
        return address(this).balance;
    }

    function withdrawAmount(uint256 amount) public {
        require(msg.sender == wallet);
        require(amount <= getBalance());
        msg.sender.transfer(amount);
    }    

    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        require(msg.sender == wallet);
        address oldOwner = _owner;
        _owner = newOwner;
    }

}
function renounceOwnership() public virtual onlyOwner {
    _setOwner(address(0));
}

/**
 * @dev Leaves the contract without owner. It will not be possible to call
 * `onlyOwner` functions anymore. Can only be called by the current owner.
 *
 * NOTE: Renouncing ownership will leave the contract without an owner,
 * thereby removing any functionality that is only available to the owner.
 */