2.5 Smart Contracts
Smart contracts (or simply contracts) are fundamental to what Ethereum is all about. Conceptually, contracts are very similar to the concept of classes in object oriented programming and that's because they encapsulate a state in the form of variables, and logic that allow to modify that state in the form of functions.
These contracts can inherit from other contracts, they can interact with other contracts and support a very rich environment where one can specify different types of interactions between these components.
Contracts contain different components, including structures, enums, state variables, events, errors, modifiers, constructor and various functions. Some of these concepts should be familiar from other programming languages, but there are also some very Ethereum specific aspects, such as those related to state variables or events, or something that's specific to Solidity
in the case of modifiers.
Contracts can come in different types: they could be either vanilla contracts, libraries or even interfaces.
Last updated