Legal Institutions in MAS: the case of contracts