Skip to content

Latest commit

 

History

History
131 lines (86 loc) · 3.26 KB

File metadata and controls

131 lines (86 loc) · 3.26 KB

Contributing to Quicklendx (Stellar-CLI/Soroban-sdk)

Thank you for your interest in contributing! Whether you're fixing bugs, improving documentation, or adding new smart contract we appreciate your effort.

This guide will help you get started quickly.


Prequisities

Before you begin, make sure you have the following installed:

Required Tools

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install with Homebrew (macOS, Linux):

brew install stellar-cli

Install with cargo from source:

cargo install --locked stellar-cli@23.0.0

🧪Running Project

  • From the root of the project, run the following command:
cargo build

This compiles the contract using the top-level workspace configuration.

  • To run contract tests, use the following command:
cargo test

🔬 Running Fuzz Tests

The project includes property-based fuzz tests for critical paths (invoice creation, bid placement, and settlement). These tests use proptest to generate many random inputs and verify that:

  • No panics occur
  • State remains consistent
  • Invalid inputs are properly rejected

Note: Fuzz tests are behind a feature flag to avoid interfering with CI/CD.

To run fuzz tests:

# Run all fuzz tests (with feature flag)
cargo test --features fuzz-tests fuzz_

# Run only fuzz tests with more iterations
PROPTEST_CASES=1000 cargo test --features fuzz-tests fuzz_

# Run specific fuzz test
cargo test --features fuzz-tests fuzz_store_invoice_valid_ranges

Fuzz test coverage:

  • fuzz_store_invoice_*: Tests invoice creation with various amounts, due dates, and description lengths
  • fuzz_place_bid_*: Tests bid placement with different amounts and expected returns
  • fuzz_settle_invoice_*: Tests settlement with various payment amounts

Security notes:

  • Fuzz tests validate input ranges and boundary conditions
  • All critical math operations are tested for overflow/underflow
  • State consistency is verified after each operation
  • Invalid inputs must return errors, never panic

✍️ How to Contribute

  1. Fork the repository on GitHub and clone it locally:
git clone https://github.com/your-username/quicklendx-contracts.git
cd quicklendx-contracts
  1. Create a new branch for your changes:
git checkout -b feature/your-feature-name
  1. Make your changes in the appropriate contract directory under you are assigned to.

  2. Build the contract:

cargo build
  1. Run the contract tests:
cargo test
  1. Commit your changes and push to your fork:
git add .
git commit -m "Add your commit message"
git push origin feature/your-feature-name
  1. Open a Pull Request to the main branch of this repository via Github.

💡Suggesting Improvements

if you encounter a bug or have an idea for improvement,feel free to open an issue and describe it. Contributions are welcome!