Skip to main content

Conventions

Linting and Formatting

Our linting and formatting rules are handled through configuration files which can be copy/pasted into every repo.

They are meant to be living - so if there are new features or changes to existing features, please do feel comfortable updating them.

These are the following config files worth re-using:

  1. .vscode/settings.json
  2. .eslintrc.js
  3. .eslintignore
  4. .prettierrc.js
  5. .prettierignore
  6. .solhint.json
  7. .solhintignore

Code Regions

We use Code Regions to seperate solidity code for ease of reading, for example:

// ------------------------------------------------------ Solidity Overrides
// ------------------------------------------------------ View Functions
// ------------------------------------------------------ Structs

These are arbitrary and use whatever regions are appropriate for the contract you are writing.

.env files

Always ensure .env is included in .gitignore so that it is not checked in - and then create a .env.template with the required environment values and keep that up to date in source control.