Thanks for your interest in contributing! This is a reusable Foundry library for the EIP-2535 Diamond Standard, so contributions that improve reliability, gas efficiency, or developer experience are welcome.
- Foundry installed
- Familiarity with the EIP-2535 Diamond Standard
git clone https://github.com/dadadave80/diamond-lib.git
cd diamond-lib
forge install
forge buildforge test -vvv- Fork the repo and create a branch from
main. - Make your changes in the appropriate directory:
src/facets/β Facet contractssrc/libraries/β Core librariessrc/interfaces/β Interfacessrc/initializers/β Initializer contracts
- Add or update tests in
test/to cover your changes. - Run
forge fmtto format your code. - Ensure all tests pass with
forge test. - Open a pull request against
main.
- Keep gas efficiency in mind β this library is optimized for minimal overhead.
- Follow existing code style and naming conventions.
- One logical change per PR β avoid bundling unrelated changes.
- Selectors are self-reported on-chain via ERC-8153
exportSelectors(). When you add an external/public function to a facet, you MUST also add its selector to that facet'sexportSelectors(), extend the expected set intest/ExportSelectorsTester.t.sol, and exercise it through the diamond with a routed-call test. A function omitted fromexportSelectors()will not be cut in or routed β and no test will fail unless you add one. - Include test cases for both success and failure paths.
If you find a bug, please open an issue with:
- A clear description of the problem
- Steps to reproduce
- Expected vs. actual behavior
For security vulnerabilities, please follow the process in SECURITY.md instead.