103 - Contract Types
-
Abstract Contracts: Contracts need to be marked as abstract when at least one of their functions is not implemented. They use the
abstract
keyword. -
Interfaces: They cannot have any functions implemented. There are further restrictions:
- They cannot inherit from other contracts, but they can inherit from other interfaces
- All declared functions must be external
- They cannot declare a constructor
- They cannot declare state variables. They use the
interface
keyword.
-
Libraries: They are deployed only once at a specific address and their code is reused using the DELEGATECALL opcode. This means that if library functions are called, their code is executed in the context of the calling contract. They use the
library
keyword.
- Base -> Derived
- Constructors
- Constructors Called -> Linearization Rules
- Constructor Arguments
- Inheritance List or Derived Constructor