How A Smart Contract Works