EXHIBIT 4.1 TWELFTH AMENDMENT TO FIRST AMENDED, RESTATED, AND COMBINED LOAN AGREEMENT DATED AUGUST 28, 1997 BY AND BETWEEN CARRIZO OIL & GAS, INC. AND COMPASS BANK This Twelfth Amendment to the Loan Agreement (this "Twelfth Amendment") by and between CARRIZO OIL & GAS, INC., a Texas corporation (the "Borrower"), and COMPASS BANK, an Alabama state chartered bank, formerly a Texas chartered bank (the "Bank"), is entered into on this 25th day of July 2001. WITNESSETH: Borrower and Bank entered into a First Amended, Restated, and Combined Loan Agreement dated August 28, 1997, as amended by the First Amendment thereto dated December 23, 1997, the Second Amendment thereto dated December 30, 1997, the Third Amendment thereto dated July 30, 1998, the Fourth Amendment thereto dated September 24, 1998, the Fifth Amendment thereto dated March 22, 1999, the Sixth Amendment thereto dated April 23, 1999, the Seventh Amendment thereto dated August 27, 1999, the Eighth Amendment thereto dated November 11, 1999, the Ninth Amendment thereto dated December 15, 1999, the Tenth Amendment thereto dated November 3, 2000 and the Eleventh Amendment thereto dated April 4, 2001 (collectively, the "Loan Agreement"). Borrower has requested, among other things, that Bank grant certain waivers and amend certain provisions of the Loan Agreement, and Bank has agreed to such requests, subject to the terms and conditions set forth in this Twelfth Amendment. Capitalized terms used, but not defined herein, shall have the meanings prescribed therefor in the Loan Agreement. NOW, THEREFORE, in consideration of the mutual promises herein contained, and for other good and valuable consideration, the receipt and sufficiency of which are acknowledged by Borrower and Bank, and each intending to be legally bound hereby, the parties agree as follows: 1. Specific Amendments to Loan Agreement. Article I, Definitions, is hereby amended by adding the following definitions thereto: "CCBM" means CCBM, INC, a Delaware corporation, a wholly owned Subsidiary of Borrower. "Permitted CCBM Indebtedness" is the Indebtedness of CCBM described on Schedule 1.01(b) of this Agreement. "Twelfth Amendment" means the Twelfth Amendment to this Agreement executed by Borrower and Bank on July 25, 2001. Section 5.19, Tangible Net Worth Requirement, is hereby amended by replacing the sum "$34,000,000.00" that appears therein with the sum "$49,000,000.00," and by replacing the date "December 31, 1999" that appears in two different places therein with the date "March 31, 2001". Section 5.20, Cash Flow to Debt Service Ratio, is hereby amended by replacing in its entirety the text of subparagraphs (a) and (b) thereof with the following: (a) "EBITDA" shall be defined as the sum of net income plus interest (net of interest income), taxes, depletion, depreciation, amortization, any other non-cash charges, and capitalized "cash" income not reflected in the consolidated income statements of Borrower and its Subsidiaries, less non-cash income items of Borrower and its Subsidiaries, and all capitalized general and administrative expenses, including capitalized expenses relating to full-time staff salaries allocated to projects; provided, however, that any items of EBITDA that relate exclusively to Oil and Gas Properties of CCBM that are not included in the Borrowing Base Properties shall, for purposes of this Section 5.20, be excluded from the calculation of EBITDA. (b) "Debt Service" shall be defined as the sum of (i) actual cash principal and interest amounts (including any capitalized interest payments) that Borrower or any of its Subsidiaries is obligated to pay during such quarter on Indebtedness other than in connection with this Agreement and (ii) cash principal and interest amounts (including any capitalized interest payments) required to be paid by Borrower during such quarter in connection with this Agreement (excluding payments made pursuant to the Chase Transaction, the repayment of the Subordinated Promissory Note and the repayment of the Permitted CCBM Indebtedness); provided that the interest under (i) and (ii) above shall be net of interest income. Section 6.01, Other Indebtedness, is hereby amended by deleting the word "and" that appears immediately before clause (g) thereof, and by deleting the period from the end of such section and adding the following text: and (h) the Permitted CCBM Indebtedness. Section 6.03, Loans, Advances or Investments, is hereby amended by substituting a semicolon in place of the period at the end of such section, and adding the following text thereto: provided, however, that Borrower shall be permitted to contribute initial capital to CCBM in connection with the formation of CCBM, not to exceed $1,000 and thereafter, provided no Event of Default or Unmatured Event of Default has occurred and is continuing, and no Event of Default or Unmatured Event of Default would otherwise result from any such payment, Borrower shall be entitled to contribute or otherwise loan or advance to CCBM such funds as are necessary to permit CCBM to make the scheduled payments described on Schedule 1.01(b) hereto relating to the Permitted CCBM Indebtedness. The Agreement, is further amended by adding thereto new Schedule 1.01(b) in the form attached to the Twelfth Amendment. I. Certain Waivers. Bank hereby waives Borrower's compliance with the negative covenants in Sections 6.01, 6.03 and 6.04 of the Agreement to the extent, but solely to the extent, necessary to permit CCBM to acquire on a basis that is entirely nonrecourse to CCBM and/or Borrower an undivided fifty percent (50%) interest in approximately 120,000 net acres of coalbed methane leases ("Coalbed Methane Leases") covering lands in the states of Wyoming and Montana pursuant to the Purchase and Sale Agreement, the Assignment, the Promissory Note and the Deed of Trust (collectively the "RMG Transaction Instruments") described on Exhibit "A" to the Twelfth Amendment. 2. Conditions Precedent in Connection with the Twelfth Amendment. The Twelfth Amendment shall not be binding on the Bank until satisfaction of the following conditions precedent: (a) Receipt of Twelfth Amendment and Compliance Certificate. Bank shall have received multiple fully executed counterparts of the Twelfth Amendment, as requested by Bank, and the Compliance Certificate duly executed by an authorized officer for Borrower. (b) Receipt of RMG Transaction Instruments. Bank shall have received true and complete copies of multiple fully executed counterparts of the RMG Transaction Instruments described on Exhibit "A" attached to this Twelfth Amendment, as requested by Bank, duly executed by an authorized officer for Borrower and the other parties to such RMG Transaction Instruments. (c) Accuracy of Representations and Warranties and No Event of Default. After giving effect to the Twelfth Amendment, the representations and warranties contained in Article IV of the Loan Agreement shall be true and correct in all material respects on the date of the Twelfth Amendment with the same effect as though such representations and warranties had been made on such date; and after giving effect to the Twelfth Amendment, no Event of Default shall have 3 occurred and be continuing or will have occurred upon the execution of the Twelfth Amendment. (d) Legal Matters Satisfactory to Special Counsel to Bank. All legal matters incident to the consummation of the transactions contemplated by the Twelfth Amendment shall be satisfactory to the firm of Porter & Hedges, L.L.P., special counsel for Bank. (e) Legal Fees. All reasonable legal fees and expenses owed by Bank to Porter & Hedges, L.L.P. in connection with the Loan Agreement shall have been paid by Borrower. (f) No Material Adverse Change. No material adverse change shall have occurred since the date of the Loan Agreement in the condition, financial or otherwise, of Borrower. 3. Reaffirmation of Representations and Warranties. To induce Bank to enter into this Twelfth Amendment, Borrower hereby reaffirms, as of the date hereof, after giving effect to the Twelfth Amendment, its representations and warranties contained in Article IV of the Loan Agreement and in all other documents executed pursuant thereto, and additionally represents and warrants as follows: A. The execution and delivery of this Twelfth Amendment and the performance by Borrower of its obligations under this Twelfth Amendment are within Borrower's power, have been duly authorized by all necessary corporate action, have received all necessary governmental approval (if any shall be required), and do not and will not contravene or conflict with any provision of law or of the articles of incorporation, charter or bylaws of Borrower or of any agreement binding upon Borrower. B. The Loan Agreement as amended by this Twelfth Amendment, represents the legal, valid and binding obligations of Borrower, enforceable against Borrower in accordance with its terms, subject as to enforcement only to bankruptcy, insolvency, reorganization, moratorium or other similar laws affecting the enforcement of creditors' rights generally. C. No Event of Default or Unmatured Event of Default has occurred and is continuing as of the date hereof. D. The RMG Transaction Instruments delivered by Borrower to Bank pursuant to Section III(b) of the Twelfth Amendment are true and complete copies of the originals of each of said documents. 4 4. Defined Terms. Except as amended hereby, terms used herein that are defined in the Loan Agreement shall have the same meanings in this Twelfth Amendment. 5. Reaffirmation of Loan Agreement. This Twelfth Amendment shall be deemed to be an amendment to the Loan Agreement, and the Loan Agreement, as further amended hereby, is hereby ratified, approved and confirmed in each and every respect. All references to the Loan Agreement herein and in any other document, instrument, agreement or writing shall hereafter be deemed to refer to the Loan Agreement as amended hereby. 6. Entire Agreement. The Loan Agreement, as hereby further amended, embodies the entire agreement between Borrower and Bank and supersedes all prior proposals, agreements and understandings relating to the subject matter hereof. Borrower certifies that it is relying on no representation, warranty, covenant or agreement except for those set forth in the Loan Agreement as hereby further amended and the other documents previously executed or executed of even date herewith. 7. Governing Law. THIS TWELFTH AMENDMENT SHALL BE GOVERNED BY AND CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE STATE OF TEXAS AND THE APPLICABLE LAWS OF THE UNITED STATES OF AMERICA. This Twelfth Amendment has been entered into in Harris County, Texas, and it shall be performable for all purposes in Harris County, Texas. Courts within the State of Texas shall have jurisdiction over any and all disputes between Borrower and Bank, whether in law or equity, including, but not limited to, any and all disputes arising out of or relating to this Twelfth Amendment or any other Loan Document; and venue in any such dispute whether in federal or state court shall be laid in Harris County, Texas. 8. Severability. Whenever possible each provision of this Twelfth Amendment shall be interpreted in such manner as to be effective and valid under applicable law, but if any provision of this Twelfth Amendment shall be prohibited by or invalid under applicable law, such provision shall be ineffective to the extent of such prohibition or invalidity, without invalidating the remainder of such provision or the remaining provisions of this Twelfth Amendment. 9. Execution in Counterparts. Each party hereto acknowledges that this Agreement may be executed in several counterparts by each party at different times and in different locations; that each separate counterpart bearing the signature of any party may be effectively delivered to the other parties by the delivery of an electronic facsimile sent via telecopier; that each party so delivering any such counterpart shall be bound by its facsimile signature thereon; and that the signature pages from counterparts signed by each party may be collated into one or more copies of 5 this agreement, which shall constitute one and the same agreement among all parties hereto. 10. Section Captions. Section captions used in this Twelfth Amendment are for convenience of reference only, and shall not affect the construction of this Twelfth Amendment. 11. Successors and Assigns. This Twelfth Amendment shall be binding upon Borrower and Bank and their respective successors and assigns, and shall inure to the benefit of Borrower and Bank, and the respective successors and assigns of Bank. 12. Non-Application of Chapter 346 of Texas Finance Codes. In no event shall Chapter 346 of the Texas Finance Code (which regulates certain revolving loan accounts and revolving tri-party accounts) apply to this Loan Agreement as hereby further amended or any other Loan Documents or the transactions contemplated hereby. 13. Notice. THIS TWELFTH AMENDMENT TOGETHER WITH THE LOAN AGREEMENT, AND THE OTHER LOAN DOCUMENTS REPRESENT THE FINAL AGREEMENT BETWEEN THE PARTIES AND MAY NOT BE CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS OR SUBSEQUENT ORAL AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS BETWEEN THE PARTIES. IN WITNESS WHEREOF, the parties hereto have caused this Twelfth Amendment to be duly executed as of the day and year first above written. BANK BORROWER COMPASS BANK CARRIZO OIL & GAS, INC. By: By: ------------------------------------- ---------------------------------- Kathleen J. Bowen Frank A. Wojtek Vice President Vice President 6 SCHEDULE 1.01(b) PERMITTED CCBM INDEBTEDNESS The Indebtedness evidenced by that certain non-recourse promissory note in the amount $7,500,000 dated June 29, 2001, executed by CCBM, Inc. as Maker, payable to the order of Rocky Mountain Gas, Inc. ("RMG"), as Payee, said note bearing interest at the rate of eight percent (8%) per annum with principal payable in forty-one (41) equal monthly installments of $125,000.00, each, with a balloon payment of $2,375,000.00 due forty-two (42) months from the date of the note, the Indebtedness evidenced by said note being non-recourse to CCBM and/or Borrower, and being secured only by CCBM's interest in the Coalbed Methane Leases purchased by CCBM with the note; and Contingent liability in the aggregate amount of $5,000,000.00 representing CCBM's proportionate share of costs and expenses to be incurred in the performance of RMG's 2001/2002 drilling program, as said drilling program is described in Section 2.1 of the Purchase and Sale Agreement dated June 29, 2001 between CCBM, as Purchaser, and RMG, as Seller. 1 EXHIBIT "A" COAL BED METHANE LEASE ACQUISITION DOCUMENTS 1. Purchase and Sale Agreement dated June 29, 2001, between CCBM, as Purchaser, and RMG, as Seller. 2. Partial Assignment of Bill of Sale and Conveyance dated June 29, 2001, from RMG and U.S. Energy Corp., collectively as Assignor, to CCBM, an Assignee. 3. Promissory Note dated June 29, 2001, by CCBM, as Maker, payable to the order of RMG, as Payee, the terms of which are described on Schedule 1.01(b) attached to this Twelfth Amendment. 4. Mortgage and Financing Statement from CCBM, as Grantor, to RMG, as Mortgagee, dated June 29, 2001, covering CCBM's interest in the Coalbed Methane Leases to secure payment of the promissory note described in item 3, above. 1 COMPLIANCE CERTIFICATE I, Frank A. Wojtek, Vice President of CARRIZO OIL & GAS, INC. (the "Company"), pursuant to Article III(a) of the Twelfth Amendment to the First Amended, Restated, and Combined Loan Agreement dated as of August 28, 1997, by and among COMPASS BANK ("Bank") and the Company (the "Agreement") do hereby certify, as of the date hereof, that to my knowledge: 1. After giving effect to the Twelfth Amendment, no Event of Default (as defined in the Agreement) has occurred and is continuing, and no Unmatured Event of Default (as defined in the Agreement) has occurred and is continuing; 2. No material adverse change has occurred in the business prospects, financial condition, or the results of operations of the Company since the date of the previous Financial Statements (as defined in the Agreement) provided to Bank; 3. After giving effect to the Twelfth Amendment, each of the representations and warranties of the Company contained in Article IV of the Agreement is true and correct in all respects. This certificate is executed this 25th day of July 2001. -------------------------------------- Frank A. Wojtek