
59 Cal.App.3d 633 (1976)
131 Cal. Rptr. 145
RAYMOND A. RUSSELL et al., Plaintiffs and Appellants,
v.
HARRY SOLDINGER et al., Defendants and Respondents. RAYMOND A. RUSSELL et al., Plaintiffs and Appellants,
v.
RONALD J. WELLS, Defendant and Respondent.
Docket No. 47800.
Court of Appeals of California, Second District, Division Three.
June 29, 1976.
*635 COUNSEL
Joseph M. Fredricks and William Haber for Plaintiffs and Appellants.
Henry Phillip Starr for Defendants and Respondents.
OPINION
ALLPORT, Acting P.J.
In these consolidated actions plaintiffs seek a declaration that defendants hold certain Kern County real property in *636 trust for them and for an order compelling transfer of legal title and possession thereof to them or, in the alternative, a judgment for monetary damages. The gravamen of the actions lies in breach by defendants of an alleged oral agreement to refrain from competitive bidding for the property at a probate sale and for defendants, as highest bidders, to take title jointly with plaintiffs on a 50-50 basis. The alleged agreement was made at the time of the sale, at which time Russell and Soldinger were strangers.
At the outset of a court trial by stipulation the transcript of proceedings had on October 12, 1972, in the matter of the estate of Bessie L. Stillwell, superior court number NCP 5649G was introduced in evidence as plaintiffs' exhibit No. 1. Exhibits 2 and 3 comprised an exchange of correspondence occurring subsequent to the probate sale wherein Russell seeks to confirm the agreement and the same is disavowed by Soldinger's attorney. In addition depositions of Rodney Lukens, a witness to the alleged agreement, and Raymond Russell were filed. An opening statement was then made by counsel for plaintiffs wherein the court was advised that the subject land was at one time an asset of the Stillwell estate and appraised in the estate at $48,000. In the summer of 1972 plaintiff Russell, experienced in the sale of similar land, was approached by the executor of the estate relative to purchase of the property actually valued at $100,000. Russell made a $50,000 bid and put $1,000 down payment in escrow. A higher offer was made but Russell decided not to bid further at the time but rather to await the probate confirmation of sale to be held October 12, 1972. On this date Russell, defendant Soldinger and three other persons appeared to bid. After the bidding had commenced the following occurred:
"At about one-third of the way along in the bidding when it was around 60-some thousand dollars and the transcript of that proceeding has been introduced here, Mr. Soldinger, who was standing shoulder to shoulder with Mr. Russell, leaned over and said to him words to the effect, `Let's go 50-50 on this deal. Let's not bid against each other.' Mr. Russell thought about it very briefly, I grant you. He did think about it and he agreed. He said, `Okay, let's go 50-50;' and at that point they joined together to purchase this property.
"THE COURT: At what dollar amount was that when they joined?
"MR. HABER: It was at the time that there was a bid of  on page 6 of that transcript, Your Honor, starting at line 21. Mr. McFarlane made a *637 bid of 66.6 and request the court for clarification of terms. There was this break in the proceedings....
"MR. HABER: Very good. It was at this point in the proceedings that the transaction took place. The joint venture agreement was created.
"After Mr. Russell said, `Yes, all right, let's do it,' Mr. Soldinger then said to him, `Let me put in the last bid.'
"Now, the testimony will show by way of not only the testimony of Mr. Russell, but by the testimony of Mr. Nigro, who was standing next to and slightly behind Mr. Soldinger, and a Mr. Lukens, an employee of Southern California Bonding Company, who was sitting in the spectator section approximately 10 feet from the counsel table directly behind Mr. Soldinger and Mr. Russell, that thereafter bidding proceeded and at a point  I direct the court's attention to page 8 line 22  at a point when the bidding was at $67,850, which was a bid made by Mr. McFarlane, Mr. Russell, who had not made a bid since the time of the agreement, noticed that Mr. McFarlane was nudging Mr. Soldinger. He also noticed Mr. McFarlane hand Mr. Soldinger a piece of paper or a card. Couldn't read it, but he saw it. And he observed Mr. Soldinger shaking his head and nodding as if, `Leave me alone,' to Mr. McFarlane; and fearing that the court would knock down the bid on Mr. McFarlane's last bid, placed a bid of $68,000."
Thereafter the bidding continued between McFarlane and Soldinger until the property was sold to Soldinger for $80,000, without Russell having made a further bid. In a trial brief filed on the date of trial the trial court was advised that Russell had authority and the intent to bid as high as $100,000 for the land and would have done so but for the agreement with Soldinger.
At the conclusion of the opening statement the following occurred:
"THE COURT: The general principle, as both counsel know, is that he who comes into equity must come in with clean hands, as Witkin said at page 5223:
"The court neither aids in the commission of a fraud by enforcement of a contract nor relieves one of the parties to a fraud from its consequences where both are in pari delicto.
*638 "It appears from the detailed opening statement that both the plaintiff and the defendant did participate in conduct which has led to what the plaintiff in the case complains is an inequity to him, seeks the aid and assistance of the court in enforcing the agreement between the two parties before the court who participated in what is an obvious act of misconduct before the probate court. And, therefore, I feel that the court at least is inclined to grant judgment to the defendant based upon the plaintiff's opening statement and the documents before the court....
"THE COURT: Mr. Haber, do you wish to be heard before the court rules?
"MR. HABER: [For Plaintiffs] Your Honor, I do feel under the circumstances I am taken aback by the court's position at this time.
"THE COURT: You really shouldn't be. You shouldn't be taken aback. I can understand why you would. Almost every lawyer I have ever run across in the court always sees his client's case and, thus, the old adage that perhaps you are too close to the forest to see the trees.
"MR. HABER: You may be correct, Your Honor, but I cannot see a wrongful intent which gives rise to this doctrine.
"THE COURT: Your client is a real estate broker?
"MR. HABER: That is correct, who had never been at a probate sale.
"THE COURT: But he understands ethics, I am sure, and just as you as an attorney are held to the highest ethical standard, so is your client, the real estate broker.
"MR. HABER: As to his clients.
"THE COURT: And as to the public and as to the probate court. When he steps into court, he comes in as a licensed public official, and he owes a duty to the court not to participate in collusive activity with another bidder which was entered into right at the counsel table. This wasn't a joint venture where the two individuals who were aware of the property met over a conference table and agreed that they, because of the size and nature and scope of the property, will join together in one common bid and they enter the courtroom as a common bidder with specific *639 identifiable terms and conditions of their bid; but they enter into that agreement, by your statement, your opening statement, and by your other written documents, before the court at the counsel table.
"MR. HABER: That is correct, there is no denying it.
"THE COURT: Your client must realize and recognize in his heart that that was a wrongful act, and I believe the defendant must know. The defendant has, incidentally, denied by his answer that he participated in such an agreement. Your client says that he entered into it; the defense denies it; so if the defense position is sustained that he did not enter into it, you fail in the burden of proof, then the defendant would win on his denial. If you prevail, you can only do so by your allegations of collusive conduct, and, therefore, the court 
"MR. HABER: Assuming that's what it is, Your Honor 
"THE COURT:  I am convinced that the court's position is absolutely sound and unassailable. You make the motion, counsel, the court will grant the motion to give judgment to the defendant on the opening statement.
"MR. STARR: We will so move, Your Honor, thank you." The motion was granted and a judgment entered in favor of defendants pursuant to Code of Civil Procedure section 581c. Plaintiffs' motion for a new trial was denied and they now appeal from the judgment and the order denying the motion for a new trial. While the latter order is not directly appealable the propriety of same may be reviewed on appeal from the judgment. (Capaldi v. Levy, 1 Cal. App.3d 274, 277 [81 Cal. Rptr. 629].)

Contentions
Conceding that in appropriate circumstances a nonsuit on the opening statement may be granted in a court trial (Nelson v. Specialty Records, Inc., 11 Cal. App.3d 126, 141 [89 Cal. Rptr. 540]; Gonsalves v. City of Dairy Valley, 265 Cal. App.2d 400, 402-404 [71 Cal. Rptr. 255]), plaintiffs contend that the opening statement contained facts sufficient to constitute a cause of action in law for breach of contract and fraud and in equity for the creation of a constructive trust and that, absent evidence of the intention of the parties, the court erred in nonsuiting plaintiffs. It is suggested that, once the court admitted any evidence, the only applicable statute was Code of Civil Procedure section 631.8 authorizing judgment *640 in a court trial after plaintiffs introduced all of their evidence and the court has made formal findings of fact as provided in Code of Civil Procedure sections 632 and 634.

Discussion
(1) The law governing review of an order granting a nonsuit on the opening statement in a nonjury trial is summarized in Calrow v. Appliance Industries, Inc., 49 Cal. App.3d 556, 559-560 [122 Cal. Rptr. 636], as follows:
"As was said by the court in Timmsen v. Forest E. Olson, Inc., 6 Cal. App.3d 860, at pages 867-868 [86 Cal. Rptr. 359]: `A motion for nonsuit upon an opening statement is authorized by section 581c of the Code of Civil Procedure. In connection therewith the court must accept as true all of the facts set forth in the statement, must give those facts all the value to which they are legally entitled, and must indulge in every legitimate inference which may be drawn therefrom. A nonsuit is warranted only when the court concludes from such facts and inferences that as a matter of law there will be no evidence of sufficient substantiality to support a judgment in favor of the plaintiff. (Stephan v. Proctor, 235 Cal. App.2d 228, 231 [45 Cal. Rptr. 124]; Bocker v. Miller, 213 Cal. App.2d 345, 347 [28 Cal. Rptr. 818]; 2 Witkin, Cal. Procedure (1954) Trial § 125 et seq.)'
"However, as was said in Palazzi v. Air Cargo Terminals, Inc., 244 Cal. App.2d 190, at pages 194-195 [52 Cal. Rptr. 817]: `A nonsuit may be granted on opening statement only "where it is clear that counsel has undertaken to state all of the facts which he expects to prove and it is plainly evident that the facts thus to be proved will not constitute a cause of action." (Weyburn v. California Kamloops, Inc., supra; Bias v. Reed, supra; Greenwood v. Mooradian, supra; Wright v. Arcade School Dist., 230 Cal. App.2d 272, 275 [40 Cal. Rptr. 812].) It may be granted where plaintiff has been afforded full opportunity to present all of the facts and such presentation shows the inadequacy of the case as a matter of law. (Nault v. Smith, 194 Cal. App.2d 257, 261 [14 Cal. Rptr. 889]; Stephan v. Proctor, 235 Cal. App.2d 228, 231 [45 Cal. Rptr. 124]; see Nuffer v. Insurance Co. of North America, 236 Cal. App.2d 349, 361-362 [45 Cal. Rptr. 918].)' (See Young v. Desert View Management Corp., 275 Cal. App.2d 294, 295-296 [79 Cal. Rptr. 848]; Wright v. Arcade School Dist., 230 Cal. App.2d 272, 275 [40 Cal. Rptr. 812].)"
*641 The nonsuit in the instant case was granted solely upon the ground that the agreement forming the basis for this litigation was unenforceable as being contrary to public policy and illegal. We must determine the correctness of this ruling as a matter of law,[1] or, as urged by plaintiffs, decide whether evidence of intent of the parties should have been considered by the trial court before determining the illegality of the agreement. (2) In this respect it is also suggested that by admitting exhibits 1, 2, and 3, in evidence the proceedings had gone beyond the opening statement stage and should have been allowed to proceed to trial. We have no problem as to the latter contention. The record discloses that the only document admitted in evidence remotely bearing on the transaction was exhibit 1, the transcript of proceedings had in the Stillwell estate confirmation hearing. Exhibits 2 and 3 had no bearing on the issue before the trial court. The transcript as such was not considered by the trial court but only those portions thereof as were narrated by counsel in the opening statement. It appears clear that the nonsuit was in fact granted upon the opening statement. This conclusion is borne out by the fact that much of the argument at the hearing of the motion for new trial was devoted to the propriety of granting the nonsuit on the opening statement under section 581c.
(3a) Turning to the question of illegality of the agreement, the opening statement revealed that two experienced real estate operators, strangers to each other, began bidding at a probate sale for the purchase of estate property worth $100,000. At least one was authorized to bid up to that sum and would have done so except for the on-the-spot agreement with the other to limit the bidding. The only inference to be drawn is that an effort to make an advantageous purchase at the expense of the estate was intended by the parties. Such an agreement is clearly contrary to public policy and is void and unenforceable.
The consideration for a contract must be lawful. (Civ. Code, § 1607.) If any part of the consideration is unlawful the entire contract is void. (Civ. Code, § 1608.) Consideration is unlawful if it is contrary to an express provision of law, contrary to the policy of express law, though not expressly prohibited, or is otherwise contrary to good morals. (Civ. Code, § 1667.) The object of a contract is the thing which it is agreed, on the part of the party receiving the consideration, to do or not to do. (Civ. *642 Code, § 1595.) The object must be lawful when the contract is made. (Civ. Code, § 1596.)
(4) Whether or not a contract in any given case is contrary to public policy is a question of law to be determined from the circumstances of each particular case. (Spangenberg v. Spangenberg, 19 Cal. App. 439, 446-447 [126 P. 379].)
(5) "It is equally well settled that if the question of illegality develops during the course of a trial, a court must consider it whether pleaded or not, `and when a court discovers a fact which indicates that the contract involved is illegal and ought not to be enforced, it will, on its own motion, instigate an inquiry in relation thereto ... Whenever the evidence discloses the relations of the parties to the transaction to be illegal and against public policy, it becomes the duty of the court to refuse to entertain the action. Whether the evidence comes from one side or the other, in the absence of a pleaded and proved exception to the general rule, the disclosure is fatal to the case, and the court is justified in rendering judgment that neither party take anything from the other.' (12 Cal.Jur.2d, p. 306, § 106.)" (Agran v. Shapiro, 127 Cal. App.2d Supp. 807, 826 [273 P.2d 619].)
(3b) We have no hesitancy in concluding that the contract in the instant case is contrary to public policy, illegal, void and therefore unenforceable.
In Butler v. Agnew, 9 Cal. App. 327 [99 P. 395], plaintiff sought an accounting from defendant resulting from the purchase and sale of real property. The court said at pages 328-329:
"The trial court found that plaintiff was the agent of the trustees of the Doran estate for the sale of a lot of land in the city of Los Angeles, and was employed by them to procure a purchaser for the said lot of land in consideration of a commission to be paid to him. That while plaintiff was employed and acting as such agent he induced and procured defendant to buy said property, and that defendant purchased the same, paid the consideration for and received the conveyance thereof in her own name for the benefit of herself and the plaintiff (and not solely for her own use), pursuant to an agreement in writing, dated December 23, 1903, which was in the words and figures following:
*643 "`This agreement made and entered into between A.C. Butler and Mary C. Agnew both of the city of Los Angeles, state of California:
"`Whereby the said Butler and Agnew buy jointly the Doran property 55 x 135 feet with improvements at the southwest corner of Olive street and Olive court, Los Angeles, California.
"`The property to be first put in the name of Mary C. Agnew, who when the property is acquired from the Doran estate, said Mary C. Agnew is to deed to A.C. Butler a half interest in said property to be acquired by loans and sold within a year. Said purchasers Agnew and Butler to be jointly liable for debts of said property and share equally in profits from same.'"
In holding the agreement unenforceable the court said at pages 331-332:
"The rule that a contract which is against public policy, good morals, or the express mandate of the law cannot be made the basis of any action, legal or equitable, has been declared so often as not to need repetition or citation of authority. This is not questioned by appellant, and it also appears to be conceded that the relations between an agent for the sale of land and his principal are of a fiduciary nature, and that the acts of such agent in the course of his employment are governed by the same rules as those of a trustee. But appellant contends that the contract here is legal on its face, and that sufficient facts outside of the contract have not been alleged or found to show that the contract is illegal or contrary to public policy. He also claims that the contract is severable, and, while its validity in part may be questioned, its valid portion may be enforced and he is entitled to recover under its provisions.
"The rule to be applied in such a case is based upon sound public policy and has no consideration for the party against whom the relief is sought, and takes no note of the fact that he will be benefited by the refusal of the court to grant the relief. It is for the sake of the law itself that the machinery of the courts is not permitted to be used for the enforcement of such contracts, and the parties are left precisely where the breach of their illegal contract finds them. Neither the silence nor consent of the parties to the contract, or of either of them, would justify the court in retaining jurisdiction of such an action. (Union Collection *644 Co. v. Buckman, 150 Cal. 159, 164, [119 Am. St. Rep. 164, 88 Pac. 708].) It matters not that there is no actual fraud in the transaction, or that no injury resulted to the principal. The rule is intended to prevent the possibility of wrong; and, assuming that plaintiff and Mrs. Agnew paid full value for the property, this is not a defense. The purchase by the agent without the knowledge of the principal is sufficient to avoid the transaction. (Burke v. Bours, 92 Cal. 115, [28 Pac. 57].) The agency of the plaintiff, his concealment of the sale from his principal, the sale by plaintiff, as agent, to himself  that is, to defendant for his benefit  are all clearly alleged and found. This shows the contract sought to be enforced to be violative of law, contrary to public policy, and unlawful under section 1667 of the Civil Code."
In Kopasz v. Wymer, 118 Cal. App.2d 119 [257 P.2d 707], it was held that a contract in which one or more parties agree to extend or withhold affirmative action as an aid in cutting off the rights of a legatee, devisee or other person not a party to the agreement, will not be enforced by the courts because it is against public policy and void. In so holding the court said at page 121:
"A contract in which one or more parties agree for a valuable consideration to extend or withhold affirmative action as an aid in cutting off the rights of a legatee or devisee or other party not a party to the agreement will not be enforced by the courts because it is against public policy and therefore void. (Gugolz v. Gehrkens, 164 Cal. 596, 603 [130 P. 8, 43 L.R.A.N.S. 575]; Scott v. Beams, 122 F.2d 777, 784; vol. II, Restatement of the Law of Contracts, 1932, p. 1082, § 577.)
"Applying the foregoing rule to the facts alleged in the amended complaint it is evident that the effect of the agreement between plaintiff and Alice Canfield was to provide that plaintiff would get one-third of the property listed as the separate property of Alice Canfield which was not actually inventoried in the estate of Lee Canfield and subject to distribution thereunder. The effect of this agreement would be to deprive Dorothy O. Eastman, one of the legatees under the will of Lee Canfield, and not a party to the agreement, of her interest in the disputed property and likewise to deprive the probate court administering Lee Canfield's estate from properly performing its duties, and deprive the State of California and the United States government of taxes properly due on said property.
*645 "It is thus clear that the agreement was void as against public policy and the trial court properly sustained the demurrer to the pleading without leave to amend." (See also Danielwitz v. Sheppard, 62 Cal. 339; Tappan v. Albany Brewing Co., 80 Cal. 570 [22 P. 257].) The "chilling" of competitive bidding is frowned upon by the courts. (Crawford v. Maddux, 100 Cal. 222, 225 [34 P. 651]; Packard v. Bird, 40 Cal. 378, 383; Roberts v. Salot, 166 Cal. App.2d 294, 298-299 [333 P.2d 232].)
(6) Plaintiffs argue that the doctrine of "clean hands" referred to by the trial court is an equitable doctrine and that, since they seek both equitable and legal relief, it was error not to distinguish between the causes of action in equity and law. We need not indulge in a lengthy discourse on this subject. As indicated above the agreement in question, being contrary to public policy and void, is unenforceable in either a court of equity or in a court of law. (Lee On v. Long, 37 Cal.2d 499, 502 [234 P.2d 9]; Butler v. Agnew, supra, 9 Cal. App. 327, 331-332.) In DeGarmo v. Goldman, 19 Cal.2d 755, 764-765 [123 P.2d 1], it was said:
"The rule in this regard is a fundamental one. (Bennett v. Brown, 206 Cal. 424 [274 Pac. 532]; Young v. Young Holdings Corp., Ltd., 27 Cal. App. (2d) 129 [80 Pac. (2d) 723]; Baar v. Smith, 97 Cal. App. 398 [275 Pac. 861]). It was succinctly explained in Allstead v. Laumeister, 16 Cal. App. 59, 64 [116 Pac. 296], where the court, quoting from Pomeroy's Equity Jurisprudence, said that `"whenever a party, who, as actor, seeks to set the judicial machinery in motion and obtain some remedy, has violated conscience, or good faith, or other equitable principle, in his prior conduct, then the doors of the court will be shut against him in limine; the court will refuse to interfere on his behalf, to acknowledge his right, or to award him any remedy."' (See, also, Richman v. Bank of Perris, 102 Cal. App. 71 [282 Pac. 801].)
"The action of equity courts in their interposition on behalf of suitors for any and every purpose and in their administration of any and every species of relief, is guided and regulated by this principle. It differs from the maxim, `he who seeks equity must do equity' in that the latter assumes that different equitable rights have arisen from the same subject matter or transaction, some in favor of plaintiff and some in favor of the defendant so that the plaintiff is required to recognize and provide for defendant's rights and his relief is granted only upon a showing that defendant's rights are protected. Therefore, as the very foundation of an equity forum is good conscience, any really unconscientious conduct *646 connected with the controvery to which he is a party is sufficient justification for the court to close its doors to him, nor does the fact that a plaintiff may have no adequate remedy at law justify disregarding the maxim. (Miller v. Kraus, [Cal. App.] 155 Pac. 834.) The burden is on the one coming into a court of equity for relief to prove not only his legal rights but his clean hands, and he may not rely on any deficiencies that may be laid at the door of the defendants. (Richman v. Bank of Perris, supra.)"
Furthermore, an illegal contract cannot be ratified and generally speaking no person is estopped to assert the illegality. (Kiely Corp. v. Gibson, 231 Cal. App.2d 39, 46 [41 Cal. Rptr. 559].)
(7) Plaintiffs suggest the court erred in not permitting the introduction of testimony calculated at disclosing the intent of the parties in entering into the transaction. We do not agree. The facts stated disclose an intent to restrict the bidding in order to obtain an economic advantage at the expense of the estate during a legal proceeding calculated to insure a fair disposition of property under judicial supervision. Furthermore, neither the trial court nor this court has been made aware by offer of proof or otherwise of any facts which would permit of a conclusion that these parties entertained any intent to benefit the estate in the premises.[2]
The judgment is affirmed.
Cobey, J., and Potter, J., concurred.
NOTES
[1]  Plaintiffs do not contend that they were not afforded a full opportunity to present all of the facts in their opening statement. No request for further elaboration on the subject was made at the time the court ruled on the motion for nonsuit.
[2]  Prior to ruling on the motion the trial court stated: "Mr. Haber, do you wish to be heard [further] before the court rules?" This query elicited no material response.
