An agreement is void if it is illegal or violates public policy.
1.2.9 Legality of Purpose Copy
This is an example of a void contract. Contrast this to a contact entered into by a minor or an intoxicated person which may be voidable at the option of the minor or intoxicated person.