A Language-Based Approach To Smart Contract Engineering