unlock
unlock copied to clipboard
Solidity contracts lint rules
Describe the solution you'd like Create a smart contract style guide to answer common questions / best practices.
Questions (we can add to this overtime):
- Use public variables or private w/ getter
- When to use events
- Accept arrays for batch transactions? Or always keep functions single purpose and use batch transactions instead.
What do you think @clemsos ?
yes possibly. We can have general rules written down, maybe even explicit the existing ones (like the mixins etc).
Also would be good to enforce things with a stronger linter - goes with #7739 too.
Renamed as « define sol contracts mint rules » so it becomes more actionable.
Here is a new plugin just out to support prettier for solidity https://github.com/prettier-solidity/prettier-plugin-solidity/releases/tag/v1.0.0?utm_source=substack&utm_medium=email
looking into it, solhint does quite a good job of catching inconstencies in contract writing style. We just need to enforce these better - that requires a rewriting/reordering of some functions and variables names