Class properties of a contract
Solidity is often called a contract-oriented language, as every operation that can occur on the blockchain must reside inside the scope of a contract. A contract serves as a template definition for the functions and variables, very similar to the definition inside a class for an object-oriented language. Like a class, contracts can inherit from other contracts.
A contract can contain declarations ranging from functions and function modifiers, state variables, events, enum, and struct types. Figure 6.4 summarizes these declarations in a tabular representation.
For further details and nuances, solidity has a freely available public documentation site. The document is generated using the sphinx package of the Python ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access