Skip to content

πŸ“Œ Contribution guidelinesΒ #19

@Vectorized

Description

@Vectorized

Most of the stuff here are similar to solmate's.

Points that are specific to solady are marked with a β™‘.

Emoji key for Issues and PRs

Format: <emoji><space><Title>

Type Emoji
readme/docs πŸ“
new feature ✨
refactor/cleanup ♻️
nit πŸ₯’
security fix πŸ”’
optimization ⚑️
configuration πŸ‘·β€β™‚οΈ
events πŸ”Š
bug fix 🐞

Styling

  • Comments must have periods after every sentence.
  • Underscore prefix are reserved for private and internal functions and variables in contracts.
  • Variables and code expressions in comments should be backquoted (e.g. `b`). β™‘
  • Memory addresses and memory related constants should be in hexadecimal format (e.g. 0x20). β™‘
    This is to convey semantic meaning, and aid readability for binary / hexadecimal natives.
  • Please keep the maximum line length, including comments to 100 characters or below. This is a balance between the old-school 80 character limit and the newer 120 character limit in the Solidity style guide. This makes it easier to read code on small or split screens. β™‘
  • Constants must be in ALL_CAPS. If it is a private or internal constant in a contract, prefix it with an underscore. β™‘
  • Fuzz tests are simply testDescription. Let's normalize fuzz testing. β™‘

File naming

Let's stick to solmate's, to maintain drop-in compatibility for the select few classes and libraries we have.

It's a mouthfeel over consistency thing.

Compiler / Transpiler safety

Make sure your PR's are compilable with --via-ir. β™‘

Care must be taken when using the slot keyword in Yul,
to ensure that the code is compatible with upgradeable contract transpilers. β™‘

Others

Our SafeTransferLib library accepts address instead of ERC20. β™‘

This is intentional for better cross-compatibility with OpenZeppelin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions