What is a contract and what rules apply to contracts?