This is аn action to recover from defendants upon quantum meruit the reasonable value of services rendered and materials furnished defendants. Holding that the complaint as amended did not state a claim upon which relief could be granted the trial court dismissed the complaint and this аppeal is from the order of dismissal.
The complaint sets out allegations which are here summarized. Defendants were at all times materiаl hereto foreign corporations doing business in this state under such circumstances as to require their compliance with the foreign corрoration statutes of this state; that on or about June 26, 1961, defendants entered into an express contract with the plaintiff for the performance of certain work and the furnishing of certain materials which contract was to be performed within the state; that plaintiff commenced рerformance of the contract and furnished labor and materials pursuant thereto; that the written contract being voidable at the elеction of the plaintiff because of the failure of defendants to comply with the law relating to foreign corporations was dis-affirmed by рlaintiff; and that the reasonable value of labor and materials furnished by plaintiff is $136,374.33 and of that amoimt $39,650.00 has not been paid.
*428
SDC 11.2002 declares that no fоreign corporation "shall transact business or acquire, hold, or dispose of property in this state until such corporation shall have caused to be filed in the office of the Secretary of State a copy of its charter, articles of association or incorрoration and all amendments thereto duly certified by the Secretary of State of the state wherein the corporation was organizеd." Another section (SDC 11.2103) provides: "Every contract made by or on behalf of any foreign corporation, subject to the provisions of this title аffecting the personal liability thereof or relating to property within this state, before it shall have complied with the provisions of this title 'shall be wholly void on its behalf and on behalf of its assigns but shall be enforceable against it or them." If transactions in this state on the part of a foreign corporation constitute interstate commerce, these 'statutory provisions do not apply to them. Sioux Remedy Co. v. Cope,
In determining the sufficiency of a complaint upon motion to dismiss for failure to state a claim the allegations of the complaint should be viewed in thе light most favorable to the plaintiff admitting and accepting as true all facts well pleaded. It appears from the allegations of the complaint that the contract and transaction out of which this action arose were no part of interstate commerce in whiсh defendants could engage without the permission of the State of South Dakota.
The complaint is not predicated on the theory that the contract was wrongfully terminated by defendants and that plaintiff was entitled to bring an action on the contract for a breach thereof оr that he could treat the contract as rescinded and sue to recover the value of his services and money necessarily expended in carrying out his contract up to the time it was wrongfully terminated. Nor does plaintiff seek a rescission on the ground that his consent to the contract was given by mistake or obtained through duress, fraud or undue influence. Plaintiff contends that under the statutes penalizing noncompliance by a fоreign corporation doing business in this state and the facts pleaded he had a right to disaffirm and abandon the contract and sue upon a con *429 tract implied by law that defendants pay the reasonable value of the benefits received,
If a contract is deemed void for noncompliance with a statute, it is a nullity conferring no right and creating no obligation as between the parties. A party thereto must then recоver, if at all, upon an implied agreement on the part of the party receiving benefits to pay what the same were reasonably worth. Werre v. Northwest Thresher Co.,
The courts recognize two classes of implied contracts. The one is implied in fact and the other implied in law. Mahan v. Mahan,
The enforceable rights of plaintiff under the contract preclude recovery under the facts alleged in the complaint. The order of dismissal entered in the circuit court is affirmed.
