2. It is a general rule, that the law will never give its aid to a party who has entered into an illegal contract, whether the same be in direct violation of a statute, against public policy, or opposed to public morals. .Nor to a contract which is fraudulent, which affects the defendant or a third person.
3. A contract in violation of a statute is absolutely void, and, however disguised, it will be set aside, for no form of expression can remove the substantial defect inherent in the nature of the transaction; the courts will investigate the real object of the contracting parties, and if that be repugnant to the law, it will vitiate the transaction.
4. Contracts against the public policy of the law, are equally void as if they were in violation of a public statute; a contract not to marry any one, is therefore illegal and void. See Void.
5. A contract against the purity of manners is also illegal; as, for example, a agreement to cohabit unlawfully with another, is therefore void; but a bond given for past cohabitation, being considered as remuneration for past injury, is binding. 4 Bouv. Inst. n. 3853.
6. All contracts which have for their object, or which may in their consequences, be injurious to third persons, altogether unconnected with them, are in general illegal and void. Of the first, an example may be found in the case where a sheriff's officer received a sum of money from a defendant for admitting to bail, and agreed to pay the bail, part of the money which was so exacted. 2 Burr. 924. The case of a wager between two persons, as to the character of a third, is an example of the second class. Cowp. 729; 4 Camp. 152; 1 Rawle, 42; 1 B. & A. 683. Vide lllicit; Unlawful.