Structure of a contract

The primary purpose of Solidity is to write smart contracts for Ethereum. Smart contracts are the basic unit of deployment and execution for EVMs. Although multiple chapters later in this book are dedicated to writing and developing smart contracts, the basic structure of smart contracts is discussed in this chapter. 

Technically, smart contracts are composed of two constructs—variables and functions. There are multiple facets to both variables and functions and that is again something that will be discussed throughout this book. This section is about describing the general structure of a smart contract using the Solidity language.

A contract consists of the following multiple constructs:

  • State variables
  • Structure ...

Get Solidity Programming Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.