Skip to main content

Welcome Contributors

Thank you for your interest in contributing to Reserve Folio! This guide will help you understand our development process and how to make meaningful contributions.
Reserve Folio is an open-source protocol. We welcome contributions from developers of all experience levels.

Code of Conduct

Be respectful, professional, and constructive in all interactions. We’re building a collaborative community focused on creating secure, reliable DeFi infrastructure.

Getting Started

1

Fork the Repository

Fork the Reserve Folio repository to your GitHub account.
2

Clone Your Fork

3

Set Up Development Environment

Follow the setup guide to configure your local environment.
4

Create a Branch

Create a branch for your contribution:
Use descriptive branch names:
  • feature/auction-improvements
  • fix/rebalance-overflow
  • docs/update-deployment-guide

Types of Contributions

Bug Fixes

Fix issues, resolve errors, and improve stability

Features

Add new functionality and capabilities

Documentation

Improve guides, add examples, fix typos

Tests

Expand test coverage and add edge cases

Optimizations

Reduce gas costs and improve performance

Security

Report vulnerabilities and security improvements

Development Workflow

1. Make Your Changes

Follow these best practices:
  • Follow existing code style and conventions
  • Use clear, descriptive variable and function names
  • Add comments for complex logic
  • Keep functions focused and modular
  • Use Solidity 0.8.28
  • Leverage built-in overflow protection
  • Follow Solidity Style Guide
  • Use NatSpec documentation format
  • Update inline comments and NatSpec
  • Document complex algorithms and formulas
  • Use units notation ({tok}, D27{tok/share}, etc.)
  • Update README.md if adding major features

2. Write Tests

All code contributions must include tests:
test/YourFeature.t.sol
Aim for high test coverage. New features should have >95% coverage.

3. Run Quality Checks

Before committing, run all quality checks:
All checks must pass before submitting a pull request.

4. Commit Your Changes

Use clear, descriptive commit messages following Conventional Commits:
Commit message format:
  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • test: Test additions or modifications
  • refactor: Code refactoring
  • perf: Performance improvements
  • chore: Maintenance tasks

5. Push and Create Pull Request

Then create a pull request on GitHub with:
1

Descriptive Title

Use a clear, concise title summarizing the change:
  • ✅ “Add progressive auction sizing for improved price discovery”
  • ❌ “Update stuff”
2

Detailed Description

Include:
  • What: What changes were made
  • Why: Why these changes are needed
  • How: How the implementation works
  • Testing: What tests were added/modified
3

Link Issues

Reference related issues:

Pull Request Template

Code Review Process

1

Automated Checks

CI/CD pipeline runs:
  • Code formatting verification
  • Linting checks
  • Full test suite
  • Gas usage analysis
2

Peer Review

Core contributors review:
  • Code quality and style
  • Security considerations
  • Gas optimization opportunities
  • Test coverage
3

Revisions

Address review comments and push updates:
4

Approval and Merge

Once approved, maintainers will merge your contribution.

Code Style Guidelines

Solidity Conventions

Formatting Rules

  • Indentation: 4 spaces (no tabs)
  • Line length: Maximum 120 characters
  • Naming:
    • Contracts: PascalCase
    • Functions: camelCase
    • Variables: camelCase
    • Constants: UPPER_SNAKE_CASE
    • Internal/private: _leadingUnderscore
  • Imports: Organized and grouped logically
  • Comments: Use NatSpec for all public/external functions

Units Notation

Always document units in comments:
Units notation:
  • {tok}, {share}, {reward}: Token balances
  • D18{1}: Percentage (18 decimals)
  • D27{tok/share}: Exchange rate (27 decimals)
  • D27{UoA/tok}: Price in nanoUSD (27 decimals)
  • {s}: Seconds

Security Considerations

Security is paramount. Always consider:
  • Reentrancy attacks
  • Integer overflow/underflow (use Solidity 0.8.x)
  • Access control
  • Input validation
  • Gas limit issues
  • Front-running vulnerabilities

Security Checklist

Reporting Security Vulnerabilities

DO NOT open public issues for security vulnerabilities.
If you discover a security vulnerability:
  1. Email: security@reserve.org
  2. Include:
    • Description of the vulnerability
    • Steps to reproduce
    • Potential impact
    • Suggested fix (if any)
  3. Wait for confirmation before public disclosure
We take security seriously and will respond promptly to all reports.

Gas Optimization

When optimizing for gas:

Use Gas Profiling

Compare Before/After

Document gas savings in PRs
Common optimizations:
  • Use calldata instead of memory for read-only parameters
  • Cache storage variables in memory
  • Use uint256 instead of smaller types (unless packing)
  • Avoid unnecessary storage writes
  • Use custom errors instead of string reverts

Documentation Guidelines

NatSpec Format

Inline Comments

Community

GitHub Discussions

Ask questions and share ideas

Discord

Join the Reserve Protocol community

Recognition

Valuable contributions are recognized through:
  • Attribution in release notes
  • Contributor badges
  • Potential bug bounty rewards
  • Community acknowledgment

Questions?

If you have questions about contributing:
  1. Check existing GitHub Discussions
  2. Review documentation
  3. Open a new discussion
  4. Reach out on Discord

Thank You!

Your contributions help make Reserve Folio more secure, efficient, and accessible. We appreciate your time and effort in improving the protocol.

Start Contributing

Ready to contribute? Fork the repository and start building!