Section 24 of The Indian Contract Act, 1872 View Chapter 2

Agreement void, if considerations and objects unlawful in part.

If any part of a single consideration for one or more objects, or any one or any part of any one of several considerations for a single object, is unlawful, the agreement is void.

Illustration

A promises to superintend, on behalf of B, a legal manufacture of indigo, and an illegal traffic in other articles. B promises to pay to A a salary of 10,000 rupees a year. The agreement is void, the object of As promise, and the consideration for Bs promise, being in part unlawful.