@defi-wonderland/solhint-plugin
v0.0.0-5bf2c4c3
Published
DeFi Wonderland's best practices Solhint plugin
Downloads
4
Readme
DeFi Wonderland's Solhint Plugin
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
| Name | Description |
| ----------------------------------- | ------------------------------------------------------------------------------------ |
| contract-data-order
| Contracts storage members should be ordered: constants, immutable variables, others. |
| enum-name-camelcase
| Enums name should be in CamelCase. |
| immutable-name-snakecase
| Immutable variables names should be in capitalized SNAKE_CASE. |
| import-statement-format
| Imports should specify imported node. Example: import {A} from 'b.sol'
|
| interface-member-order
| Interfaces members should be ordered: events, errors, structs, functions. |
| interface-starts-with-i
| Interfaces name should start with I
. Example: IMyContract
. |
| named-return-values
| Functions return values should be named. |
| non-state-vars-leading-underscore
| Variables that are not in the state should start with underscore. Example: _myVar
. |
| struct-name-camelcase
| Structs 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.