Context-aware contracts