The object of a contract is the thing which the party receiving the consideration agrees to do or not to do.
The object of a contract must be lawful when the contract is made and must be possible and ascertainable by the time the contract is to be performed. Everything is deemed possible except that which is impossible in the nature of things.
When a contract has only a single object, and such object is unlawful in whole or in part, or wholly impossible of performance, or so vaguely expressed as to be wholly unascertainable, the entire contract is void.
When a contract has several distinct objects, of which at least one is lawful and at least one is unlawful in whole or in part, the contract is void as to the latter and valid as to the rest.