Closed guidanoli closed 7 months ago
_
prefix to internal/private state variable names (if they don't have it already)_
prefix to internal/private function names (if they don't have it already)_
prefix from function parameters (if they have it)Let's leave this to last on the release to avoid PR conflicts.
For reference,
Order of Functions
contract A {
constructor() {
// ...
}
receive() external payable {
// ...
}
fallback() external {
// ...
}
// External functions
// ...
// External functions that are view
// ...
// External functions that are pure
// ...
// Public functions
// ...
// Internal functions
// ...
// Private functions
// ...
}
Inside each contract, library or interface, use the following order
Type declarations
State variables
Events
Errors
Modifiers
Functions
📚 Context
Solidity specifies the following style guide. There are some guidelines we don't follow. The most relevant is the naming convention of function parameters, and internal/private functions and state variables.
✔️ Solution
Update contracts to comply with the style guide. We should take the opportunity of v2 to do this refactoring, since all contracts will be redeployed anyway. Also, check if the guidelines can be checked and enforced by
prettier
.