Effect of Illegality
As a general rule, a court will not enforce an illegal contract and will leave the parties in the same position in which it finds them. One party cannot recover damages for breach of an illegal contract and there is normally no recovery in quasi contract for benefits conferred. However, if the interests of the public, as opposed to the interests of one of the parties, are served by allowing a recovery of some sort, the courts will allow such a recovery. A party who is justifiably ignorant of the facts or special regulations which make the bargain illegal may recover the consideration conferred on the other party. And a person protected by a regulatory statute may recover for breach of contract entered into with a person who has not complied with the statute. A contract made for the purpose of aiding the commission of a crime is illegal. However, mere knowledge that the article sold will be used illegally does not make the sale illegal unless the intended use is the commission of a serious crime.
A party may rescind an executory illegal contract before the performance of the illegal act and recover any consideration s/he has given to the other party. If a contract contains a legal portion and an illegal portion and the illegal portion is divisible, then the legal portion may be enforced and the rest disregarded unless the illegal parts go to the principal objective of the contract. However, if such a contract cannot be so divided, the entire contract is illegal and void.