aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-18 21:40:18 +0800
committerGitHub <noreply@github.com>2018-09-18 21:40:18 +0800
commit63c6007012c9cd8509b752e0d0adc044be366ff7 (patch)
tree8d6988e63bd2a92bb928759a51e8200fc27b7a81
parent4b656420ac84eb5c8c752d125fcd282612476b07 (diff)
parent98bc9ac32628b9f9d8d8cef5e266a785d71a11dd (diff)
downloaddexon-solidity-63c6007012c9cd8509b752e0d0adc044be366ff7.tar.gz
dexon-solidity-63c6007012c9cd8509b752e0d0adc044be366ff7.tar.zst
dexon-solidity-63c6007012c9cd8509b752e0d0adc044be366ff7.zip
Merge pull request #5002 from ethereum/docs-1394-style-guide-order
Docs: Added order of layout to style guide
-rw-r--r--docs/style-guide.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index d2de5287..511236b9 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -874,6 +874,28 @@ No::
x = y+z;
x +=1;
+***************
+Order of Layout
+***************
+
+Layout contract elements in the following order:
+
+1. Import statements
+2. Interfaces
+3. Libraries
+4. Contracts
+
+Inside each contract, library or interface, use the following order:
+
+1. Type declarations
+2. State variables
+3. Events
+4. Functions
+
+.. note::
+
+ It might be clearer to declare types close to their use in events or state
+ variables.
******************
Naming Conventions