One famous limitation of the right to contract is the unenforceability of an illegal contractual promise. Even if parties fulfill all other necessary conditions to form a valid contract, the illegality of a promise, especially if the illegal promise can cause significant harm to the public, is frequently an accepted excuse for nonperformance of a contractual promise. It is in the strong interest of society at large that contractual promises to perform illegal acts are considered unenforceable by courts. In the case of illegality, courts might consider the harm to society of upholding certain parts of some contracts in addition to the rights and interests of the parties that are engaged in a legal dispute.
One should note that many modern contracts contain many terms and promises. If some terms and promises in a contract are illegal while other terms and promises are not, then there is a possibility that some parts of the contract could still be enforceable; one can contact an attorney to discuss a particular contract and obtain a professional opinion regarding how some illegal promises contained in a contract could affect the rest of the contract.
One famous example of illegality as an accepted excuse for nonperformance is the case of Sinnar v. Le Roy from Washington State in 1954. Sinnar operated a grocery store and wanted a beer license, so he paid a private citizen named Le Roy a sum of money and in exchange Le Roy promised to either obtain a beer license or to return the money. Le Roy was not a government employee and had no legal basis through which he could perform his promise to obtain a beer license for Sinnar. Sinnar sued Le Roy to recover the money he paid to Le Roy. The Supreme Court of the State of Washington concluded that Le Roy was not liable for performing his promise to obtain a beer license for Sinnar. The case of Sinnar v. Le Roy also examined issues of whether it is the responsibility of promisor to claim illegality of a promise as an affirmative defense, and also issues of how the severity of an illegal promise can affect how the contract is enforced.
Because illegal promises are often unenforceable by courts, it may be a good idea to hire an experienced contract lawyer to review important contracts related to your business. A contract lawyer may be able to alert you that certain promises contained in your contract are illegal and therefore some of the promises in your contract may be unenforceable.
If someone is threatening to sue you or has already sued you for failing to perform an illegal promise, you may want to consider contacting an experienced attorney to represent you and argue that you are excused from nonperformance of certain contractual promises due to those promises being illegal.