From 98bc9ac32628b9f9d8d8cef5e266a785d71a11dd Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Mon, 17 Sep 2018 17:50:45 +0200 Subject: Added order of layout to style guide --- docs/style-guide.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit v1.2.3