
159 Cal.App.2d 349 (1958)
OSCAR LUND et al., Respondents,
v.
W. H. COOPER et al., Appellants.
Civ. No. 9362. 
California Court of Appeals. Third Dist.  
Apr. 14, 1958.
 Charles L. King for Appellants.
 C. Keith Lyde for Respondents. *350
 WARNE, J. pro tem.  [fn. *]
 From a judgment in favor of plaintiffs in an action to rescind and recover the down payment made on a contract for the purchase of certain real property, defendants appeal.
 On January 15, 1954, the parties to this action entered into a written contract which provided that defendants would sell, and plaintiffs would buy, certain real property upon which was situated an incomplete dwelling house. The purchase price was $14,500, of which $1,500 was paid concurrently with the signing of the contract. Under the terms of the contract, plaintiffs were to apply to the Bank of America at Gridley, California, for a secured loan of not less than $7,000, which was to be applied on the purchase price, and in addition thereto were to give the defendants a promissory note, secured by a second deed of trust, for the balance then remaining due. It appears that the parties discussed with the bank manager the obtaining of a loan, but plaintiffs did not make any formal application for such and it was not procured, probably because the bank was not interested in making a loan for $7,000. Title to the property was at all times vested in the defendants. The defendants, who were unlicensed contractors, agreed to and did complete the building according to the plans and specifications. On or about June 1, 1954, the building was substantially completed and plaintiffs then took possession and rented the premises to a tenant for three months and received $240 in rentals. Thereafter, on September 9, 1954, according to the court's finding, plaintiffs gave notice of rescission and on October 27, 1955, filed this suit to recover the $1,500 down payment. Defendants answered and by way of counterclaim alleged that they had been damaged in the sum of $1,500 by reason of the breach of the contract by the plaintiffs. Plaintiffs then amended their complaint by adding a cause of action wherein they alleged that the defendant W. H. Cooper acted in the capacity of a contractor, within the meaning of the Business and Professions Code, in constructing said house and purporting to sell it to the plaintiffs. They prayed that said contract be declared void and against public policy; that the defendants' counterclaim be denied and that the $1,500 be restored to them. The trial court found that the parties had entered into the agreement on January 15, 1954; that plaintiffs had paid, pursuant to the contract, $1,500 as part payment on the purchase price; that the defendant W. H. Cooper *351 did, in executing said contract and in constructing said house thereon and in purporting to sell said house to plaintiffs, act in the capacity of a contractor within the meaning of section 7026 of the Business and Professions Code, and that it would produce a harmful effect upon plaintiffs should the court refuse to rescind the contract and restore plaintiffs to their former position, and that plaintiffs, on September 9, 1954, gave notice of rescission. The court further found that defendants had not suffered any damage by reason of plaintiffs' failure to comply with the contract and concluded that plaintiffs were entitled to judgment for the sum of $1,260 ($1,500 less the $240 rent which the plaintiffs received) together with interest at the rate of 7 per cent from September 9, 1954, and costs. Judgment was entered accordingly and this appeal followed.
 Section 7026 of the Business and Professions Code defines a contractor as "any person, who undertakes to or offers to undertake to or purports to have the capacity to undertake to or submit a bid to, or does himself or by or through others, construct, alter, repair, ... or demolish any building, ... or other structure, project, development or improvement, or to do any part thereof, ..." Section 7030 of said code provides: "Any person who acts in the capacity of a contractor without a license, ... is guilty of a misdemeanor." Section 7031 of said code provides: "No person engaged in the business or acting in the capacity of a contractor, may bring or maintain any action in any court of this State for the collection of compensation for the performance of any act or contract for which a license is required by this chapter without alleging and proving that he was a duly licensed contractor at all times during the performance of such act or contract."
 [1] It is to be noted that the requirements of section 7031 of the Business and Professions Code are mandatory. The statute is for the protection and safety of the public and a violation thereof is a criminal offense. [2] We therefore feel that the rule of law which governs in such a case is, as stated in Smith v. Bach, 183 Cal. 259, 263 [191 P. 14]:
 "... By the weight of authority where money has been paid in consideration of an executory contract which is illegal, the party who has paid it may repudiate the agreement at any time before it is executed and reclaim the money. In such a case it is the duty of the court in furtherance of justice to aid one not in pari delicto, though to some extent involved in the illegality, but who, as here, is comparatively the more innocent, *352 and to permit him to recover back money paid on a contract as the circumstances of the case may require. [Citing cases.]"
 The plaintiffs in the instant case were not in pari delicto. [3] In Lewis & Queen v. N. M. Ball Sons, 48 Cal.2d 141, 153 [308 P.2d 713], the court said:
 "... [W]hen the Legislature enacts a statute forbidding certain conduct for the purpose of protecting one class of persons from the activities of another, a member of the protected class may maintain an action notwithstanding the fact that he has shared in the illegal transaction. The protective purpose of the legislation is realized by allowing the plaintiff to maintain his action against a defendant within the class primarily to be deterred. In this situation it is said that the plaintiff is not in pari delicto. [Citing cases.]"
 Appellant relies on Marshall v. Von Zumwalt, 120 Cal.App.2d 807 [262 P.2d 363]. Insofar as that case runs contrary to what is here said, we think it also runs counter to the cases we have cited. We feel bound by the latter cases. We therefore conclude that plaintiffs were entitled to rescind and recover the money which they paid on the down payment, less the $240 rental received.
 [4] Defendants also contend, by suggestion, that the trial court erred in allowing interest to run from the date of rescission. There is no merit in this suggestion. In an action for rescission, where the amount due from the defendant to the plaintiff is unliquidated, the interest runs only from the date of judgment. (Younis v. Hart, 59 Cal.App.2d 99 [138 P.2d 323].) However, in an action upon a rescission in pais, the right to repayment of moneys paid under the contract is fixed by the rescission and interest is thus recoverable from the date of rescission. (Hayt v. Bentel, 164 Cal. 680 [130 P. 432]; Potter v. Contra Costa Realty Co., 220 Cal. 31 [29 P.2d 189]; also see 9 Cal.Jur.2d 642, 643,  51.) Further, the money due plaintiffs at the time of rescission was capable of ascertainment by simply deducting the $240 rent received from the $1,500 down payment. (Civ. Code,  3287.)
 The judgment is affirmed.
 Van Dyke, P. J., and Peek, J., concurred.
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
