mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5002 from ethereum/docs-1394-style-guide-order
Docs: Added order of layout to style guide
This commit is contained in:
commit
63c6007012
@ -874,6 +874,28 @@ No::
|
|||||||
x = y+z;
|
x = y+z;
|
||||||
x +=1;
|
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
|
Naming Conventions
|
||||||
|
Loading…
Reference in New Issue
Block a user