Skip to content

[Contract] Add per-milestone token override for multi-token payouts #6

Open

Description

@Gbangbolaoluwagbemiga

Context

All milestones currently use the escrow's base token. Some freelancers want part in XLM (network fees) and part in a stablecoin.

What needs to be done

  • Extend milestones to `Vec<(i128, String, Option)>` — third field is optional token override
  • Validate override tokens against the platform whitelist
  • `approve_milestone` transfers the correct token per milestone
  • Backward compatible: no override = base token

Acceptance criteria

  • Per-milestone token override stored and applied
  • Unit tests: same token, mixed tokens, invalid override

Activity

  1. guptakumarranjeet150 commented on Oct 2, 2026

    @guptakumarranjeet150

    Hello team,

    I would like to take on and implement this issue: [Contract] Add per-milestone token override for multi-token payouts.

    Technical Implementation Roadmap:

    1. Formal Soroban Invariant Design: Audit storage layout (Instance, Persistent, Temporary) with strict TTL management and explicit require_auth guards.
    2. Core Rust WASM Implementation: Implement deterministic state transition handlers eliminating arithmetic overflow risks using checked/saturating math.
    3. Hermetic Testing Suite: Build comprehensive test cases in tests/ asserting authorized vs unauthorized invocations, mock auth environments, and edge value bounds.
    4. Gas & Footprint Optimization: Profile CPU/memory instruction budgets under Soroban host environment to ensure optimal runtime efficiency.

    Looking forward to delivering this robust implementation. Please assign whenever convenient!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contractSoroban / Rust smart contract workenhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions