Thank you for your interest in contributing! This guide covers everything you need to get started — from forking the repo to opening a well-formed pull request.
- Getting Started
- Branch Naming
- Development Workflow
- Pre-PR Checklist
- Opening a Pull Request
- Reporting Bugs
- Requesting Features
- Code Style
- Rust (stable toolchain)
wasm32-unknown-unknowntarget:rustup target add wasm32-unknown-unknown
cargo-llvm-covfor coverage:cargo install cargo-llvm-cov --locked
-
Fork the repository on GitHub using the Fork button at the top right.
-
Clone your fork locally:
git clone https://github.com/<your-username>/ahjoorxmr-contract.git cd ahjoorxmr-contract
-
Add the upstream remote so you can keep your fork in sync:
git remote add upstream https://github.com/ussyalfaks/ahjoorxmr-contract.git git fetch upstream
-
Keep your fork up to date before starting new work:
git checkout main git pull upstream main git push origin main
Create a dedicated branch for every contribution. Use one of the following prefixes:
| Prefix | When to use |
|---|---|
feat/ |
New feature or enhancement |
fix/ |
Bug fix |
docs/ |
Documentation only changes |
test/ |
Adding or improving tests |
chore/ |
Maintenance tasks (deps, CI, tooling, etc.) |
Examples:
git checkout -b feat/add-milestone-cancellation
git checkout -b fix/escrow-timeout-edge-case
git checkout -b docs/contributing-guidelinesKeep branch names lowercase, hyphen-separated, and descriptive.
All contracts live under contracts/. Each contract is an independent Cargo workspace member.
cargo test --manifest-path contracts/<contract-name>/Cargo.tomlcargo test --workspacecargo build \
--manifest-path contracts/<contract-name>/Cargo.toml \
--target wasm32-unknown-unknown \
--releasecargo fmt --allRUSTFLAGS="-Dwarnings" cargo clippy --all-targets --all-featuresCoverage must meet ≥ 90% line and ≥ 85% region coverage per contract. Verify locally before pushing:
cargo llvm-cov \
--manifest-path contracts/<contract-name>/Cargo.toml \
--summary-only \
--fail-under-lines 90 \
--fail-under-regions 85Run through every item below before opening a pull request:
- Branch follows the naming convention (
feat/,fix/,docs/, etc.) -
cargo fmt --all— no formatting changes outstanding -
RUSTFLAGS="-Dwarnings" cargo clippy --all-targets --all-features— zero warnings -
cargo test --workspace— all tests pass -
cargo llvm-covcoverage thresholds pass (≥ 90% lines, ≥ 85% regions) for affected contracts - New functionality is covered by tests
- Documentation/comments updated where relevant
- PR description is filled out using the PR template
- Related issue is linked with
Closes #<issue-number>in the PR description
-
Push your branch to your fork:
git push -u origin <your-branch-name>
-
Open a PR from your fork's branch against
ussyalfaks/ahjoorxmr-contract:mainon GitHub. -
Fill in all sections of the PR template — partial descriptions slow down review.
-
Link the issue your PR addresses using
Closes #<number>in the description. This automatically closes the issue when the PR merges. -
Wait for CI to pass. All checks (tests, WASM build, coverage gate) must be green before review.
-
Address review feedback by pushing additional commits to the same branch. Do not force-push after a review has started.
Use the Bug Report template. Please include:
- A clear description of the problem
- Steps to reproduce
- Expected vs. actual behaviour
- Your Rust version (
rustc --version) and OS
Search existing issues before opening a new one to avoid duplicates.
Use the Feature Request template. Please include:
- The problem or limitation you're facing
- Your proposed solution
- Alternatives you considered
- Any relevant use cases
- Follow standard Rust conventions enforced by
rustfmtandclippy. - Keep functions small and focused; add doc comments (
///) to public items. - Treat warnings as errors — CI runs with
RUSTFLAGS="-Dwarnings". - Write tests alongside new code; coverage gates are enforced in CI.
By contributing, you agree that your submissions are made under the same licence as the project. Thank you for helping make this project better!