Inheritance, Abstract Contracts, and Interfaces
Explore the concepts of inheritance in Solidity, including how base and derived contracts interact. Understand abstract contracts with virtual functions and the role of interfaces to define contract structures. This lesson helps you implement and override functions to build secure, reusable smart contracts.
We'll cover the following...
Inheritance
In object-oriented programming, inheritance is a program’s ability to use another program’s functionality. In Solidity, it allows us to extend our contracts with code that has been proven to be secure and keep them organized and maintainable. The contract providing this code is known as a base contract, whereas the inheriting contract is known as a derived contract.
We declare that a contract inherits from a source using the is keyword as if to say that the derived contract is an instance of the base ...
Code from multiple base contracts can be inherited by a single derived ...