100 - Naming Convention
-
Types: lowercase, lower_case_with_underscores, UPPERCASE, UPPER_CASE_WITH_UNDERSCORES, CapitalizedWords, mixedCase, Capitalized_Words_With_Underscores
-
Names to Avoid: l - Lowercase letter el, O - Uppercase letter oh, I - Uppercase letter eye. Never use any of these for single letter variable names. They are often indistinguishable from the numerals one and zero.
-
Contracts and libraries should be named using the CapWords style. Contract and library names should also match their filenames. If a contract file includes multiple contracts and/or libraries, then the filename should match the core contract. This is not recommended however if it can be avoided. Examples: SimpleToken, SmartBank, CertificateHashRepository, Player, Congress, Owned.
-
Structs should be named using the CapWords style. Examples: MyCoin, Position, PositionXY.
-
Events should be named using the CapWords style. Examples: Deposit, Transfer, Approval, BeforeTransfer, AfterTransfer.
-
Functions should use mixedCase. Examples: getBalance, transfer, verifyOwner, addMember, changeOwner.
- Types: lc/l_c/UC/U_C/CW/C_W/mC
- Avoid: L/I/O
- Confused with 1 & 0
- Contract -> CW
- Struct -> CW
- Event -> CW
- Function -> mC