Chapter 6: Writing Smart Contracts
Solidity is an object-oriented programming language used to write smart contracts. This chapter will discuss the design aspects of writing smart contracts, defining and implementing a contract, and deploying and creating contracts using different mechanisms—using the new
keyword and contract addresses. Object orientation is based on four concepts—abstraction, encapsulation, inheritance, and polymorphism—and this chapter will delve deep into object-oriented concepts and implementations.
This chapter covers the following topics:
- Writing a simple contract
- Creating contracts
- Creating contracts via the new and existing address
- Contract constructor
- Contract composition
- Inheritance
- Encapsulation
- Polymorphism
- Method overloading
- Abstract contracts
- Interfaces
- Advance interfaces
- Library