Blockchain Automation: How Smart Contracts Work