An Introduction to Smart Contracts