Just like object-oriented programming languages, Solidity contracts also support multiple inheritance. You can derive another contract by using the is keyword, as shown in the FuncOverride contract that we discussed in the Overloading functions section of this chapter.
The contract can access the following from its inherited contract:
- All of its modifiers. You can also override them.
- All public and internal functions. You can also override them.
- All public and internal state variables. Use these state variables directly.
- All events. You can emit these events.
When a contract inherits from another contract and a function is called, its most derived function definition will be executed from the inheritance hierarchy. However, you can also use the contract's name or the super keyword in order to use a specific function...