0.0.0-5bf2c4c3 • Published 1 year ago

@defi-wonderland/solhint-plugin v0.0.0-5bf2c4c3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

DeFi Wonderland's Solhint Plugin

image Tests License: MIT

Overview

This custom Solhint Plugin aims to contain all of the Solidity best practices implemented at DeFi Wonderland.

Setup

Setup Solhint in your Solidity project if you haven't already. Then run:

yard add -D @defi-wonderland/solhint-plugin

or

npm install --save-dev @defi-wonderland/solhint-plugin

Finally, inside your .solhint.json configuration file, add:

"plugins": [..., "defi-wonderland"],

Available Rules

NameDescription
contract-data-orderContracts storage members should be ordered: constants, immutable variables, others.
enum-name-camelcaseEnums name should be in CamelCase.
immutable-name-snakecaseImmutable variables names should be in capitalized SNAKE_CASE.
import-statement-formatImports should specify imported node. Example: import {A} from 'b.sol'
interface-member-orderInterfaces members should be ordered: events, errors, structs, functions.
interface-starts-with-iInterfaces name should start with I. Example: IMyContract.
named-return-valuesFunctions return values should be named.
non-state-vars-leading-underscoreVariables that are not in the state should start with underscore. Example: _myVar.
struct-name-camelcaseStructs name should be in CamelCase.

About DeFi Wonderland

DeFi Wonderland is a team of top Web3 researchers, developers, and operators who believe that the future needs to be open-source, permissionless, and decentralized.

DeFi sucks, but DeFi Wonderland is here to make it better.