Skip to content

Early exit with minimum commitment amount and dust handling #358

@1nonlypiece

Description

@1nonlypiece

Description

Deliver smart-contract work for commitment_core focused on: Early exit with minimum commitment amount and dust handling.

This issue is contracts-only (Soroban / Rust workspace). Do not scope frontend, backend, or off-chain services here.

Requirements and context

  • Security: Treat this as production-leaning code — validate trust boundaries, auth (require_auth where applicable), reentrancy, and arithmetic safety.
  • Quality: Changes must be reviewable, deterministic in tests, and aligned with existing patterns in this repository.
  • Testing: Add or extend tests so new/changed logic is convincingly covered; capture edge cases called out in the title.
  • Documentation: Use Rustdoc (///, //!) on public contract APIs; update docs/ when behavior is integrator-facing.

Suggested execution

Fork and branch

  • Fork the repository and create a branch:
    • git checkout -b feature/commitment-core-early-exit-with-minimum-commitment-amount-and-dust-handling

Implement changes

  • Contract / library: contracts/commitment_core/src/lib.rs
  • Tests: contracts/commitment_core/src/tests.rs
  • Docs: add or extend a focused page under docs/ when the change affects external integrators (e.g. docs/CONTRACT_FUNCTIONS.md, threat model, or crate-specific notes).
  • Comments: module and function-level Rustdoc in NatSpec style (summary, params, errors, security notes).

Validate security assumptions

  • Enumerate trust boundaries (who can call what, what storage keys mutate).
  • Confirm no unintended cross-contract calls or missing auth for state changes.
  • For math/financial paths, list overflow/underflow and rounding assumptions (tie to shared_utils::math where used).

Test and commit

  • Run tests (adjust package as needed):
    • cargo test -p commitment_core --target wasm32v1-none --release
    • or workspace: cargo test --workspace --target wasm32v1-none --release
  • Cover edge cases explicit in the issue title; attach summarized test output and short security notes in the PR description.

Guidelines

  • Minimum 95% coverage on touched contract and library code (use cargo llvm-cov locally or follow CI coverage gates if present).
  • Clear documentation: Rustdoc + relevant docs/ updates for integrators.
  • Timeframe: 96 hours from assignment to ready-for-review PR (or comment with a justified ETA).

Example commit message

feat(commitment_core): early-exit-with-minimum-commitment-amount-and-dust-handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions