A contract is a voluntary arrangement between two or more parties that is enforceable by law as a binding legal agreement. Contract is a branch of the law of obligations in jurisdictions of the civil law tradition. Contract law concerns the rights and duties that arise from agreements.
A contract arises when the parties agree that there is an agreement. Formation of a contract generally requires an offer, acceptance, consideration, and a mutual intent to be bound. Each party to a contract must have capacity to enter the agreement. Minors, intoxicated persons, and those under a mental affliction may have insufficient capacity to enter a contract. Some types of contracts may require formalities, such as a memorialization in writing.
Source – Wikipedia