diff options
Diffstat (limited to 'docs/structure-of-a-contract.rst')
-rw-r--r-- | docs/structure-of-a-contract.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/structure-of-a-contract.rst b/docs/structure-of-a-contract.rst new file mode 100644 index 00000000..c3683b5e --- /dev/null +++ b/docs/structure-of-a-contract.rst @@ -0,0 +1,17 @@ +.. index:: contract, state variable, function, event, struct, enum, function;modifier + +*********************** +Structure of a Contract +*********************** + +Contracts in Solidity are similar to classes in object-oriented languages. +Each contract can contain declarations of **state variables**, **functions**, +**function modifiers**, **events**, **structs types** and **enum types**. +Furthermore, contracts can inherit from other contracts. + +* State variables are values which are permanently stored in contract storage. +* Functions are the executable units of code within a contract. +* Function modifiers can be used to amend the semantics of functions in a declarative way. +* Events are convenience interfaces with the EVM logging facilities. +* Structs are custom defined types that can group several variables. +* Enums can be used to create custom types with a finite set of values. |