In this chapter, we take a deep-dive into smart contract designs. We start by understanding the textbook definition of a smart contract. Then we move on to understanding different smart contract models and the role of code in a smart contract. We then go through the basic anatomy of a smart contract and see how a smart contract works. Then we shift our focus to some advanced topics, such as smart contract optimization, auditing, and ERC20 compliance. We conclude the chapter with a hands-on drill of building a voting DApp.
After studying this chapter, you will be able to:
- Define a smart contract and understand various design models
- Appreciate the role of code in a smart contract
- Visualize the basic anatomy of a smart contract
- Understand smart contract optimization, auditing, and compliance
- Understand the design of a voting DApp using smart contracts...