Thank you for your interest in contributing to FactorChain! We welcome contributions from Rust developers, TypeScript engineers, security researchers, and domain experts in trade finance.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Message Format
- Pull Request Process
- Code Style Guide
- Testing Conventions
- Security
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/factorchain.git - Follow the DEVELOPMENT.md guide to set up your local environment
- Create a feature branch:
git checkout -b feat/your-feature-name
- Pick an issue — Look for open issues labeled
good-first-issueorhelp-wanted - Discuss — Comment on the issue to let others know you're working on it
- Develop — Write code, following the style and testing conventions below
- Test — Run the full test suite before submitting
- Document — Update documentation if you change any public API or add features
- Submit — Open a pull request with a clear description of changes
We use Conventional Commits with the following prefixes:
| Prefix | Usage |
|---|---|
feat: |
A new feature |
fix: |
A bug fix |
chore: |
Build process, tooling, or dependency changes |
docs: |
Documentation only changes |
style: |
Code style changes (formatting, etc.) |
refactor: |
Code changes that neither fix nor add features |
test: |
Adding or updating tests |
perf: |
Performance improvements |
ci: |
CI/CD configuration changes |
sec: |
Security fixes |
Examples:
feat(liquidity-pool): add auto-fund with risk gating
fix(marketplace): reject bids below reserve price
docs: update API endpoint descriptions
test(invoice-registry): add double-financing rejection test
- Title must follow the commit message format
- Description should explain:
- What changed and why
- How to test the changes
- Any breaking changes or migrations needed
- Linked issues — Reference related issues with
Closes #123orRelated to #456 - Checklist before requesting review:
- Code compiles without errors (
cargo build,npm run build) - All tests pass (
cargo test,npm test) - Linter passes (
cargo fmt --check,npm run lint) - No new warnings introduced
- Documentation updated (if applicable)
- Changes are covered by tests
- Code compiles without errors (
- Reviews require at least one maintainer approval
- Use
#![no_std]for all contracts - Import from
soroban_sdkonly; no std library - Use
snake_casefor function names and variables - Use
CamelCasefor types and enum variants - Panic messages should be informative:
panic!("invoice not found")instead ofpanic!("err")
- Use checked math (Soroban's
+,-,*operators use checked arithmetic by default) - All public functions must have doc comments
- Events must be published for every state-changing operation
- Tests must be in a separate
test.rsmodule
- Use NestJS conventions: modules, controllers, services
- Use
camelCasefor variables and functions - Use
PascalCasefor classes, interfaces, and types - Use Zod for all input validation
- Use Prisma for all database access
- Decorate controllers with Swagger decorators for API docs
- Use
@Public()decorator for non-authenticated endpoints - Error handling: throw
HttpExceptionwith appropriate status codes
- Use functional components with hooks
- Use
camelCasefor variables and functions - Use
PascalCasefor components - Store files in
src/features/by domain (seller, investor, buyer, admin) - Shared components go in
src/components/ui/ - Use Zustand for client state, TanStack Query for server state
- Use Tailwind CSS for styling (utility classes, no custom CSS files)
- Every contract must have unit tests in a
test.rsmodule - Cross-contract integration tests go in the marketplace contract
- Tests must cover:
- Happy path (full lifecycle)
- Error cases (each
panic!branch) - Authorization checks (unauthorized callers)
- Edge cases (zero amounts, expired deadlines, etc.)
- Event emission verification
- Use
#[test]withsoroban_sdk::testutils
- Unit tests:
*.spec.tsfiles co-located with source - Integration tests:
test/directory withjest-e2econfiguration - Test database operations with real Prisma client (use test containers or in-memory)
- Mock external services (Stellar RPC, Pinata, Resend)
- Unit tests use Vitest
- E2E tests use Playwright
- Test hook behavior, component rendering, and API integration
- Never commit private keys, secrets, or API tokens
- Run
cargo auditbefore submitting contract changes - Report security vulnerabilities privately to the maintainers
- All contract changes affecting fund custody must be reviewed by at least 2 maintainers
Open a Discussion or join our community channels listed in the README.