Thanks for your interest in contributing to op-viem! Please take a moment to review this document before submitting a pull request.
Note
Please ask first before starting work on any significant new features.
This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.
- Cloning the repository
- Installing Node.js and pnpm
- Installing Foundry
- Installing dependencies
- Running the test suite
- Writing documentation
- Submitting a pull request
- Versioning
To start contributing to the project, clone it to your local machine using git:
git clone https://github.com/wagmi-dev/viem.git --recurse-submodules
Or the GitHub CLI:
gh repo clone wagmi-dev/viem -- --recurse-submodules
You need to install Node.js v18 or higher and pnpm.
You can run the following commands in your terminal to check your local Node.js and Bun versions:
node -v
pnpm -v
If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
- Install Node.js using fnm or from the official website
- Install pnpm
op-viem uses Foundry for testing. We run a local Anvil instance against a forked Ethereum node, where we can also use tools like Forge to deploy test contracts to it.
Install Foundry using the following command:
curl -L https://foundry.paradigm.xyz | bash
Once in the project's root directory, run the following command to install the project's dependencies:
pnpm install
pnpm run test
Sometimes there may be some tests which fail unexpectedly – you can press f
to rerun them and they should pass.
When adding new features or fixing bugs, it's important to add test cases to cover the new/updated behavior.
Documentation is crucial to helping developers of all experience levels use op-viem. op-viem uses VitePress and Markdown for the documentation site (located at site
). To start the site in dev mode, run:
pnpm run dev:docs
Try to keep documentation brief and use plain language so folks of all experience levels can understand. If you think something is unclear or could be explained better, you are welcome to open a pull request.
When you're ready to submit a pull request, you can follow these naming conventions:
- Pull request titles use the Imperative Mood (e.g.,
Add something
,Fix something
). - Changesets use past tense verbs (e.g.,
Added something
,Fixed something
).
When you submit a pull request, GitHub will automatically lint, build, and test your changes. If you see an ❌, it's most likely a bug in your code. Please, inspect the logs through the GitHub UI to find the cause.