Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.36 KB

Naming Conventions Continued.md

File metadata and controls

30 lines (22 loc) · 1.36 KB
  1. Function arguments should use mixedCase. Examples: initialSupply, account, recipientAddress, senderAddress, newOwner.

  2. Local and state variables names should use mixedCase. Examples: totalSupply, remainingSupply, balancesOf, creatorAddress, isPreSale, tokenExchangeRate.

  3. Constants should be named with all capital letters with underscores separating words. Examples: MAX_BLOCKS, TOKEN_NAME, TOKEN_TICKER, CONTRACT_VERSION.

  4. Modifier names should use mixedCase. Examples: onlyBy, onlyAfter, onlyDuringThePreSale.

  5. Enums, in the style of simple type declarations, should be named using the CapWords style. Examples: TokenGroup, Frame, HashStyle, CharacterLocation.

  6. Avoiding Naming Collisions: single_trailing_underscore_. This convention is suggested when the desired name collides with that of a built-in or otherwise reserved name.


Slide Screenshot

101.jpg


Slide Deck

  • Function Arg -> mC
  • Local/State Var -> mC
  • Constant -> U_C
  • Modifier -> mC
  • Enum -> CW
  • Collision -> built-in
  • Security: Readability & Maintainability

References