You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever possible, try to keep Contracts, Libraries and Interfaces in their owns files. Additionally, they should go in their respective folders (contracts, interfaces and libs).
Order within Contract, Library or Interface
type declarations
state variables
events
functions
Function Order
Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier.
Functions should be grouped according to their visibility and ordered:
constructor
initialize()
modifiers
external
public
internal
private
Within a grouping, place the view and pure functions last.
Variable/Function naming
camelCase
events (and event params)
all state variables
public and external functions
internal functions in libraries
_underscoreCamelCase
function parameters
local variable names
internal and private functions in contracts
Note: Avoid naming variables with trailing underscore _var_.
Imports
Group by internal exports first, then external imports.