Adaptive Contracts