EXHIBIT 10.6 FIRST AMENDMENT TO SECOND AMENDED AND RESTATED CREDIT AGREEMENT THIS FIRST AMENDMENT TO SECOND AMENDED AND RESTATED CREDIT AGREEMENT is dated and effective as of October 29, 2004 (this "First Amendment"), by and among CARRIZO OIL & GAS, INC., a Texas corporation (the "Borrower"), CCBM, INC., a Delaware corporation (the "Guarantor"), and HIBERNIA NATIONAL BANK, a national banking association, individually as a Lender and as Administrative Agent, and UNION BANK OF CALIFORNIA, N.A., a national banking association, individually as a Lender and as Co-Agent. RECITALS: 1. The Borrower, the Guarantor, the Agent, and the Lenders have heretofore entered into that certain Second Amended and Restated Credit Agreement dated as of September 30, 2004 (the "Agreement"), pursuant to which the Lenders established in favor of Borrower a Line of Credit as more fully described therein. 2. All Loans by the Lenders to the Borrower are guaranteed by the Guarantor. 3. The parties desire to amend the Agreement as set forth herein. NOW, THEREFORE, the parties hereto, in consideration of the mutual covenants hereinafter set forth and intending to be legally bound hereby, do hereby amend and supplement the Agreement as follows: A. Defined Terms. Capitalized terms used herein which are defined in the Agreement are used herein with such defined meanings, as said definitions may be amended and/or supplemented by this First Amendment. B. Revision to Defined Terms. 1. The definition of the term "Secured Subordinated Debt" in Section 1.1 of the Agreement is hereby deleted and restated as follows: "Secured Subordinated Debt" shall mean indebtedness of the Borrower (and any Subsidiary of Borrower that is a Guarantor) outside of the Line of Credit, issued for total net proceeds not to exceed $28,000,000.00, which indebtedness may bear stated cash interest expense of up to 12% per annum (prior to default); provided that (i) the documents governing the issuance thereof are entered into on or before December 31, 2004 (provided that additional notes may be issued thereunder prior to October 29, 2006), (ii) if such indebtedness is secured by a mortgage lien on the Mortgaged Properties, such lien shall be subordinate and inferior to 19 the Agent's mortgage lien on the Mortgaged Properties, and (iii) the Required Lenders have reviewed and approved the documents governing said issuance. 2. The following new definitions are hereby added to Section 1.1 of the Agreement: "First Amendment" shall mean that certain First Amendment to Second Amended and Restated Credit Agreement dated as of October 29, 2004, by and among the Borrower, the Guarantor, the Agent, and the Lenders. "Interest Expense" means, for any period, total interest expense (including that portion attributable to capital lease obligations in accordance with GAAP and capitalized interest) of the Borrower and its Subsidiaries (other than Unrestricted Subsidiaries) on a consolidated basis with respect to all outstanding Obligations of the Borrower and its Subsidiaries (other than Unrestricted Subsidiaries) to the extent the promissory notes, leases or other instruments or agreements evidencing such Obligations require the payment of such interest in cash during such period. "Secured Subordinated Note Purchase Agreement" means the Note Purchase Agreement dated as of October 29, 2004 among the Borrower, the Purchasers (as defined therein) and PCRL Investments, L.P., as Collateral Agent, as amended, modified or restated from time to time. "Tangible Net Worth" means, with respect to any Person, the total assets of such Person (other than with respect to the Borrower, its Unrestricted Subsidiaries), on a consolidated basis, exclusive of (a) those assets classified as intangible, including, without limitation, goodwill, patents, trademarks, trade names, copyrights, franchises and deferred charges, (b) treasury stock and minority interests in any Person, (c) cash set apart and held in sinking or other analogous funds established for the purpose of redemption or other retirement of capital stock, (d) to the extent not already deducted from total assets, allowances for depreciation, depletion, obsolescence and/or amortization of properties, uncollectible accounts, and contingent but probable liabilities as to which an amount can be established, (e) deferred taxes and (f) all assets arising from advances to officers, former officers or sales representatives of such Person or any of its Subsidiaries (other than with respect to the Borrower, its Unrestricted Subsidiaries) made outside the ordinary course of business; less total liabilities of such Person and its Subsidiaries (other than with respect to the Borrower, its Unrestricted Subsidiaries), on a consolidated basis, 2 all of the above being determined in accordance with GAAP and, with respect to the Borrower, excluding the effect of any cumulative after-tax amounts of ceiling test write-downs (not to exceed an aggregate of $30 million) incurred subsequent to December 31, 2001 pursuant to Rule 4.10 of Regulation S-X promulgated by the Commission. C. Revised Schedule 11.1. Schedule 11.1 as attached to the Agreement is hereby deleted in its entirety and replaced with the Schedule 11.1 attached to this First Amendment. D. Restatement of Section 11.21. Section 11.21 of the Agreement is hereby deleted in its entirety and restated as follows: Section 11.21. Security Agreement. The Security Agreement constitutes a first priority security interest affecting one hundred percent (100%) of the issued and outstanding stock of the Guarantor, and there are no other Encumbrances affecting the said stock except as permitted by Section 13.4(r). E. Restatement of Section 12.8(d). Section 12.8(d) of the Agreement is hereby deleted in its entirety and restated as follows: (d) Minimum Shareholder's Equity. The Borrower shall maintain at all times a minimum shareholder's equity of not less than $100,000,000.00, plus (i) 100% of all common and preferred equity contributed by shareholders of Borrower subsequent to June 30, 2004, plus (ii) 50% of all positive earnings occurring subsequent to June 30, 2004, plus (iii) 180 days after Borrower's issuance of any of the Secured Subordinated Debt, an amount equal to 50% of the net proceeds from the issuance of any Secured Subordinated Debt; provided, however, the minimum shareholder's equity on and after April 30, 2005 shall be not less than $112,500,000.00. For purposes of this covenant, the calculation of Borrower's "shareholder's equity" will exclude the effects, if any, of ceiling test write-downs pursuant to Regulation SX4.10 of the Securities and Exchange Commission. F. Addition of New Affirmative Covenants. Article XII of the Agreement is hereby amended and supplemented to include the following new affirmative covenants as Section 12.8 (e) and Section 12.18, respectively: (e) EBITA to Interest Expense Ratio. The Borrower shall maintain as of the last day of each fiscal quarter a ratio of EBITDA for the four fiscal quarter period ending on such day to Interest Expense for such period of at least 2.60 to 1.0. 3 Section 12.18. Additional Mortgaged Properties. (a) The Borrower agrees to execute and deliver from time to time such documents as are reasonably requested by the Agent to provide that at least 90% of the net present value of the proved oil and gas reserves owned by the Borrower and each Guarantor, taken as a whole, are Mortgaged Properties, excluding Borrower's interests in the Camp Hill Field in East Texas. (b) In the event the Tangible Net Worth of any Guarantor (calculated with respect to CCBM without including the capital stock of Pinnacle so long as Pinnacle is not a Subsidiary of the Borrower) exceeds 3% or more of the Tangible Net Worth of the Borrower and its Subsidiaries, on a consolidated basis, the Borrower shall cause such Guarantor to execute and deliver to Agent, for the benefit of each Lender, Mortgages in form and substance reasonably acceptable to the Agent together with such other assignments, conveyances, amendments, agreements and other writings (each duly authorized and executed) as Agent shall reasonably deem necessary or appropriate to grant, evidence and perfect the Encumbrances in the assets and properties of such Guarantor (provided in no event shall the capital stock of Pinnacle be pledged so long as Pinnacle is not a Subsidiary). G. Restatement of Section 13.4(r). Section 13.4(r) of the Agreement is hereby deleted in its entirety and restated as follows: (r) Encumbrances affecting all or part of the Collateral that secure Secured Subordinated Debt and other indebtedness referred to in Section 13.5(l) and such other obligations and liabilities related thereto, in each case, that is subject to, and permitted to be secured by, a written subordination agreement executed by the Agent on behalf of the Lenders. H. Restatement of Section 13.5(l). Section 13.5(l) of the Agreement is hereby deleted in its entirety and restated as follows: (l) Subject to the provisions of Sections 10.2 and 13.4(r), the indebtedness evidenced by the Secured Subordinated Debt, capitalized interest thereon, and indebtedness arising under hedging agreements between the Borrower and any holder of such debt or any affiliate thereof, and guarantees executed by any Subsidiary of Borrower guaranteeing payment thereof. I. Restatement of Section 13.7. Section 13.7 of the Agreement is hereby deleted in its entirety and restated as follows: 4 Section 13.7. Other Agreements. Except as set forth in Schedule 11.1, the Borrower will not enter into any agreement containing any provision which would be violated or breached by the performance of its obligations hereunder or under any instrument or document delivered or to be delivered by it hereunder or in connection herewith; provided that the Borrower may agree to the redemption or repurchase of its securities upon a change of control or dissolution, winding-up or liquidation of, or the merger or sale of substantially all the assets of, the Borrower (provided that nothing in this Section 13.7 shall permit any action otherwise prohibited by Sections 13.1 and 13.2 hereof). J. Restatement of Section 13.11. Section 13.11 of the Agreement is hereby deleted in its entirety and restated as follows: Section 13.11. Payments on Secured Subordinated Debt. Subject to the terms and conditions of the subordination agreement referenced in Section 10.2 above, the Borrower agrees that the only scheduled payments on the Secured Subordinated Debt due prior to the later of the stated Facility A Termination Date and the stated Facility B Termination Date will be scheduled interest payments on promissory notes evidencing Secured Subordinated Debt. In addition, the Borrower agrees to the extent it has the discretion to do so, to make said interest payments by the issuance of debt or equity securities to the maximum extent permitted by the documents evidencing the Secured Subordinated Debt; provided, however, (i) during such time as the Borrower is permitted to make all or any portion of said interest payments by the issuance of debt, any remaining portion of such interest payments may be paid in cash and (ii) the Borrower shall have no obligation to issue common stock in respect of any payment under the Secured Subordinated Note Purchase Agreement to the extent such issuance would require the Borrower to issue common stock below the Floor Price (as defined in the Secured Subordinated Note Purchase Agreement) for that payment. K. Consent by Lenders to Secured Subordinated Debt. Subject to the terms and conditions of that certain Subordination Agreement of even date herewith by and among the Agent, PCRL Investments L.P. (as Subordinate Debt Agent and Purchaser), and Borrower, the Lenders do hereby permit the Secured Subordinated Debt to be issued, and the liens contemplated thereby to be granted by Borrower pursuant to the Secured Subordinated Note Purchase Agreement, and the execution of the guarantees contemplated thereby, and authorize, ratify and confirm the Agent's execution of the foregoing Subordination Agreement on behalf of the Lenders. 5 L. Confirmation of Related Documents. It is the intention of the parties that all of the liens, privileges, priorities, and equities existing and to exist under and in accordance with the terms of the Related Documents are hereby renewed, extended, and carried forward as security for the Indebtedness. In addition, the Guarantor hereby confirms its guaranty of the Indebtedness, which guaranty is evidenced by that certain Commercial Guaranty dated September 30, 2004 by Guarantor in favor of Agent. M. Representations; No Default. On and as of the date of this First Amendment, and after giving effect to this First Amendment, the Borrower and the Guarantor confirm, reaffirm, and restate the representations and warranties set forth in the Agreement and the Loan Documents; provided, that each reference to the Agreement herein shall be deemed to include the Agreement as amended by this First Amendment. N. Payment of Expenses. The Borrower agrees to pay or reimburse the Lender for all legal fees and expenses of counsel to the Agent in connection with (i) the transactions contemplated by this First Amendment and (ii) a review of the documentation for the Secured Subordinated Debt and preparation of the required subordination agreement. O. Amendments. The Agreement and this First Amendment are credit or loan agreements as described in LA. R.S. 6:ss.1121, et seq. There are no oral agreements between the Agent and Lenders and the Borrower and/or Guarantor. The Agreement, as amended by this First Amendment, and the other Loan Documents set forth the entire agreement of the parties with respect to the subject matter hereof and supersede all prior written and oral understandings between the Borrower, the Guarantor, the Agent, and the Lenders, with respect to the matters herein and therein set forth. The Agreement, as amended by this First Amendment, cannot be modified or amended except by a writing signed and delivered by the Borrower, the Guarantor, the Agent and the Lenders. P. Waiver of Defenses. In consideration of the Lenders' execution of this First Amendment, the Borrower and Guarantor do hereby irrevocably waive any and all claims and/or defenses to payment on any indebtedness arising under the Agreement and owed by any of them to the Lender that may exist as of the date of execution of this First Amendment. Q. Governing Law: Counterparts. The First Amendment shall be governed by and construed in accordance with the laws of the State of Louisiana. This First Amendment may be executed in any number of counterparts, all of which counterparts, when taken together, shall constitute one and the same instrument. R. Continued Effect. Except as expressly modified herein, the Agreement shall continue in full force and effect. The Agreement as amended herein is hereby ratified and confirmed by the parties hereto. S. Reliance on Corporate Resolutions. The Borrower and the Guarantor hereby certify to the Lenders that the resolutions delivered in connection with the Agreement remain in effect, and that Paul F. Boling is authorized to execute this First Amendment on behalf of Borrower and Guarantor. 6 IN WITNESS WHEREOF, the parties hereto have caused this First Amendment to be executed and delivered as of the date hereinabove provided by the authorized officers each hereunto duly authorized. Borrower: CARRIZO OIL & GAS, INC. a Texas corporation By: /s/ Paul F. Boling ------------------- Name: Paul F. Boling Title: Vice President and Chief Financial Officer Guarantor: CCBM, INC. a Delaware corporation By: /s/ Paul F. Boling ------------------ Name: Paul F. Boling Title: Vice President and Chief Financial Officer Agent: HIBERNIA NATIONAL BANK, as Agent By: /s/ David R. Reid ----------------- Name: David R. Reid Title: Senior Vice President Lenders: HIBERNIA NATIONAL BANK By: /s/ David R. Reid ----------------- Name: David R. Reid Title: Senior Vice President UNION BANK OF CALIFORNIA, N.A. By: /s/ Damien Meiburger -------------------- Name: Damien Meiburger Title: Senior Vice President 7 Schedule 11.1 Although the Borrower is not required by the documents evidencing the Secured Subordinated Debt to issue Capital Stock in payment of the Secured Subordinated Debt, pursuant to such documents it has the option to do so. Under certain circumstances the Borrower is required to repurchase such Capital Stock. Such repurchase would violate Section 13.3 of the Agreement.