Skill 2.2.1
Apply inheritance, interfaces, abstract contracts and libraries
Key Concepts
A contract inherits with is, for example contract MyToken is ERC20, Ownable. Functions that may be overridden are marked virtual, and overriding functions are marked override (listing the bases when several define the function). Solidity resolves multiple inheritance with C3 linearisation, so bases are listed from "most base-like" to "most derived", and super.f() calls the next contract in that order.
An interface declares only external functions, events and errors, with no state or implementation; it is how contracts call each other and how standards are defined. An abstract contract may contain implemented code and may leave functions unimplemented (a contract with any unimplemented function must be declared abstract); it cannot be deployed. A library has no state; its internal functions are copied into the calling contract, while external and public library functions are deployed once and called with delegatecall. using Lib for Type; lets library functions be called as methods.