The Foundations of Engineering Contracts