Book Image

Learn Ethereum

By : Xun (Brian) Wu, Zhihong Zou, Dongying Song
Book Image

Learn Ethereum

By: Xun (Brian) Wu, Zhihong Zou, Dongying Song

Overview of this book

Ethereum is a blockchain-based, decentralized computing platform that allows running smart contracts. This book provides a basic overview of how Ethereum works, its ecosystem, mining process, and the consensus mechanism. It also demonstrates a step-by-step approach for building decentralized applications. This book begins with the very basics of Blockchain technology. Then it dives deep into the Ethereum architecture, framework and tools in its ecosystem. It also provides you an overview of ongoing research on Ethereum, for example, Layer 1 and 2 scaling solution, Stablecoin, ICO/STO/IEO, etc. Next, it explains Solidity language in detail, and provides step-by-step instructions for designing, developing, testing, deploying, and monitoring decentralized applications. In addition, you’ll learn how to use Truffle, Remix, Infura, Metamask, and many other Ethereum technologies. It’ll also help you develop your own cryptocurrency by creating ERC20, and ERC721 smart contracts from scratch. Finally, we explain private blockchains, and you learn how to interact with smart contracts through wallets.
Table of Contents (19 chapters)
Free Chapter
1
Section 1: Blockchain and Ethereum Basics
5
Section 2: Blockchain Development Cycle
8
Section 3: Ethereum Implementations
12
Section 4: Production and Deployment
16
Section 5: Conclusion

Putting it all together – rental property leasing

In this section, we will implement and deploy a smart contract for a real-world rental property leasing use case.

The business process for a rental property being leased starts with the landlord creating a rental property listing and allowing the tenants to apply and sign the leasing agreement. Once the tenant moves in, they have to pay monthly rent to the landlord, and once the lease term is due, the lease is terminated. If the tenant misses a rent payment, the landlord has the option to start an eviction, and if the tenant terminates the lease early, they have to pay the early termination penalty.

The following is the high-level diagram of our rental property lease contract:

As we explained earlier, the smart contract is developed using a combination of the access control design pattern and the state machine design pattern...