The object and purpose must be legal for a contract to be legal. If its purpose is illegal because of statue of common law, the contract may be void. If the formation or the performance of a contract is illegal, resulting in a crime and/or tort, or opposing public policy or interest, the contract is usually considered void. For example:
Any contract that involves purchasing a stolen item or an illegal drug, or involves fraud or harming someone would be considered void.
Contracts to commit crimes or to engage in immoral acts are void. Contracts of gambling are void.
Also, contracts in restraint of trade are void if they are too wide. For instance, I sell my business of civil engineering contractor to John. To prevent me starting up in business again and competing with him, John insists that a clause be included in the sale agreement stipulating that I will never again engage in the business of civil engineering contracting. This agreement would be void. If John had insisted on a clause that I would not engage in civil engineering contracting within a radius of 10 kilometres and for a period of three years afterwards, then that agreement would probably be valid and enforceable. The restriction must do no more that protect the goodwill of the business that John bought. Anything beyond that will be unenforceable.
Section 10 (Indian Contracts Act) states that all agreements are contracts if made for lawful considerations and with lawful object. Considerations should be lawful, as otherwise, it would vitiate the whole contract and make it void.
For example, A promises to pay B Rs 500/- if he commits a theft in C’s house. Such a promise will not be enforced by law even if B has committed a theft because the object of consideration of the promise is unlawful.
Section 23 also lays down that every agreement of which the object or consideration is unlawful is void. It, therefore follows that every contract, in order to be valid must be made for