Enforceable contract, which can set up both orally and in writing, have four key elements:
An intent to create legal relations. Casual commitments among friends and family, for example, lack such intent.
A bargain, throuch which both parties get something in return of what they offer. Promises to make gifts, for example, are not contracts.
Both parties need to be serious about the commitment being made. Promises made clearly as jokes, or not intented to be taken literally, are not contracts.
Legality and morality. Promises are bargains about illegal or immoral transactions, for example an agreement between a robber and his buyer, are not contracts and therefore cannot be legally enforced.