Inheritance
Inheritance is one of the pillars of object orientation and Solidity supports inheritance between smart contracts. Inheritance is the process of defining multiple contracts that are related to each other through parent-child relationships. In inheritance, there is a parent contract and child contracts deriving from the parent contract. Inheritance is defined using an is-a
relationship between parent and child contracts. The child contract inherits all the functions of the parent contract. There is another terminology to refer to parent and child contracts—base (parent) contract and derived (child) contracts.
Inheritance is about code reusability. As mentioned before, there should be an is-a
relationship between parent and child contracts, and all public-, external- and internal-scoped functions and state variables are available to derived contracts. In fact, internally, the Solidity compiler copies the base contract bytecode into the derived contract bytecode...