aboutsummaryrefslogtreecommitdiffstats
path: root/docs/structure-of-a-contract.rst
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-08 04:16:25 +0800
committerchriseth <c@ethdev.com>2015-12-08 05:35:51 +0800
commit64fa9ca478b95970825e3b783275ee66cf848358 (patch)
tree0e968e61d604d86197151a69ad38d0d2b07daa80 /docs/structure-of-a-contract.rst
parentba8bc4565aa0e5c41be107a7bbae3b51c74679c6 (diff)
downloaddexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.tar.gz
dexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.tar.zst
dexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.zip
Imported documentation.
Diffstat (limited to 'docs/structure-of-a-contract.rst')
-rw-r--r--docs/structure-of-a-contract.rst17
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.