Any city or district is authorized to enter into contracts or compacts with any operating agency or a publicly or privately owned public utility for the purchase and sale of electric energy or falling waters: PROVIDED, That no city or district may enter into a contract or compact with an operating agency to purchase electric energy, or to purchase or participate in a portion of an electrical generating project, that commits the city or district to pay an amount in excess of an express dollar amount or in excess of an express rate per unit of electrical energy received.