By this appeal we are called on to decide whether as construed below a statute of North Dakota, chapter 238, Laws 1919, is repugnant to the due process or equal protection clause of the Fourteenth Amendment. It declares:

'Sec. 1. Reasonable Time to Discover Defects. Any person, firm or corporation purchasing any gas or oil burning tractor, gas or steam engine, harvesting or threshing machinery for their own use shall have a reasonable time after delivery for the inspection and testing of the same, and if it does not prove to be reasonably fit for the purpose for which it was purchased the purchaser may rescind the sale by giving notice within a reasonable time after delivery to the parties from whom any such machinery was purchased, or the agent who negotiated the sale or made delivery of such personal property or his successor, and placing same at the disposal of the seller.

'Sec. 2. Provisions Contrary to Preceding Section Void. Any provision in any written order or contract of sale, or other contract which is contrary to any of the provisions of this Act is hereby declared to be against public policy and void.'

The complaint of appellee, plaintiff below, shows the following facts: August 13, 1928, defendant, in consideration of $1,360 to be paid by plaintiff according to his three promissory notes given therefor, sold and delivered to the latter a harvester-combine to be used for the cutting and threshing in a single operation of grain raised by him. Plaintiff undertook by means of the machine so to cut and thresh his crop, but upon a fair trial and test he found that it was defective and could not be used or made fit to operate for the purpose. September 5 he rescinded the sale in the manner prescribed by the statute. His notes remained wholly unpaid. He prayed judgment that defendant return them to him for cancellation. The answer, asserting that the statute is repugnant to the due process and equal protection clauses, does not deny the complaint, but avers that plaintiff gave defendant a written order by which he waived all warranties, express, implied or statutory, and unconditionally promised to pay the price represented by the notes. Plaintiff demurred. The trial court sustained the demurrer, and, defendant having elected to stand on its answer, gave plaintiff judgment in accordance with the prayer of the complaint. The Supreme Court affirmed. 241 N.W. 722.

On the facts alleged in the complaint, section 15(1) of the Uniform Sales Act, Laws 1917, c. 202, implied a warranty by defendant that the machine was reasonably fit in a single operation to cut and thresh plaintiff's grain. Allis-Chalmers Mfg. Co. v. Frank, 57 N.D. 295, 299, 221 N.W. 75. But it left plaintiff free to waive such warranty and to purchase on the terms referred to in the answer. Section 71. Minneapolis Threshing Mach. Co. v. Hocking, 54 N.D. 559, 569, 209 N.W. 996.

The question is whether the challenged enactment of 1919 may prohibit such waivers as contrary to public policy and void, and so limit the right of seller and purchaser to contract. While that right is a part of the liberty protected by the due process clause, it is subject to such restraints as the state in the exertion of its police power reasonably may put upon it. But freedom of contract is the general rule and restraint the exception. The exercise of legislative authority to abridge it can be justified only by the existence of exceptional circumstances. Adkins v. Children's Hospital,
261 U.S. 525, 545, 546, 43 S.Ct. 394, 67 L.Ed. 785, 24 A.L.R. 1238, and cases cited. In determining the validity of a legislative declaration that a contract is contrary to public policy, regard is to be had to the general rule that competent persons shall have the utmost liberty of contracting, and that it is only where enforcement conflicts with dominant public interests that one who has had the benefit of performance by the other party to a contract will be permitted to avoid his own promise. Cf. Steele v. Drummond,
275 U.S. 199, 205, 48 S.Ct. 53, 72 L.Ed. 238; Twin City Pipe Line Co. v. Harding Glass Co.,
283 U.S. 353, 356, 51 S.Ct. 476, 75 L.Ed. 1112.

The object sought to be attained by the statute under consideration is to protect farmers in an agricultural state against losses from investments in important machines that are not fit for the purposes for which they are purchased and to guard against crop losses likely to result from reliance upon such machines. It applies only to sales made to purchasers requiring for their own use the relatively complicated and costly implements referred to in section 1. These are used on farms producing grain, and the raising of such crops is North Dakota's principal industry. Enormous quantities of farm machinery are required in that state, and expenditures therefor constitute a large part of the total investment in farm land and equipment. Most, if not all, of the tractors, engines, harvesters, and threshers referred to are made outside North Dakota by a few manufacturers who, through their agents or dealers, sell them directly to farmers. Forms of sales contracts generally used are prepared by sellers, and, as pointed out in the opinion of the state Supreme Court, the tendency has been to restrict the rights of purchasers and to lessen the liability of sellers. Such machines can properly be tested only during seasons in which they are used, and, especially in the case of harvester and thresher combines, these periods are short. The machine sold to plaintiff is a gas and oil-burning harvester and thresher combine. Machines designed for such purposes are necessarily complex, and even under favorable conditions their effective use requires skill, experience, and resourcefulness on the part of operators. In determining whether they are reasonably suitable and fit for the purposes intended, there is involved a consideration of the kind and condition of the crops to be harvested, the periods during which they remain recoverable after becoming sufficiently ripe and dry to be contemporaneously cut and threshed, the amount and kind of weeds and other foreign vegetation growing with the grain, the topography of the fields, and the rainfall, dew, and humidity. Such combines have not been long known or much used in the grain-raising Northwest, and undoubtedly there are ample grounds for a legislative finding that the farmers of North Dakota as a class are not sufficiently familiar with them to be able, without actual test, to form an intelligent opinion as to their fitness to cut and thresh in a single operation or whether they safely may be regarded as dependable for use on their farms. If they were relied on generally in that state and should fail in the fields, the resulting losses would be of such magnitude and public concern as to warrant the adoption of measures calculated to guard against them.

The regulation imposed seems well calculated to effect the purposes sought to be attained. The evils aimed at do not necessarily result from misrepresentation or any fraud on the part of sellers, and at least one of the purposes of the legislation is to lessen losses resulting from purchasers' lack of capacity, without opportunity for inspection and trial, to decide whether the machines are suitable. The statute prevents waiver of the warranty of fitness implied by the state law. Such warranties tend to restrain manufacturers from selling unfit or defective machines and also from selling anyeven those of appropriate design and construction for operation in some regionsfor use in places or under conditions not permitting effective service. And the right of inspection, test, and rescission that the statute assures to purchasers enables them, free from peril of serious mistakes, deliberately to consider whether such machines are reasonably suitable or fit for the purposes for which they want to use them. There is nothing in this case to suggest that, under the guise of permissible regulation, the state unreasonably deprives sellers of such machines of their right freely to contract or that in its practical operation the statute arbitrarily burdens their business. Burns Baking Co. v. Bryan,
264 U.S. 504, 44 S.Ct. 412, 68 L.Ed. 813, 32 A.L.R. 661; Weaver v. Palmer Bros. Co.,
270 U.S. 402, 46 S.Ct. 320, 70 L.Ed. 654. The state, in order to ameliorate the evils found incident to waivers of implied warranties of fitness, merely declares that such agreements in respect of the sale of the designated machines are contrary to public policy, and holds the parties to the just and reasonable rule prescribed by section 15(1) of the Sales Act. Upon the question of due process more need not be said.

The character of the machines, the need of tests to determine their fitness, the serious losses that ensue if in actual use they prove unfit and the other considerations alluded to plainly warrant the classification and special regulation of sales prescribed by the statute.