Skip to content

[CON-01] Complete payment_escrow Soroban smart contract #1150

Description

@yusuftomilola

Overview

The payment_escrow contract at contracts/payment_escrow/ is a skeleton. It is responsible for holding funds for monthly/quarterly/yearly bookings and releasing or refunding them — the core escrow lifecycle that the NestJS backend depends on.

Context

  • Language: Rust 2021 edition, Soroban SDK (no_std)
  • Shared types in contracts/common_types/src/types.rs
  • The access_control contract governs who can trigger releases and refunds
  • Backend calls this contract via @stellar/stellar-sdk in backend/src/payments/providers/soroban-escrow.provider.ts

Tasks

  • Implement create_escrow(booking_id, amount, member_address, hub_address, unlock_date) — creates escrow, stores state in contract storage
  • Implement release(escrow_id, caller) — callable only by hub address or access_control admin; transfers funds to hub address
  • Implement refund(escrow_id, caller) — callable only before unlock_date or when a cancellation flag is set; returns funds to member
  • Implement get_escrow(escrow_id) — read-only view of escrow state (amount, status, parties)
  • Add contract tests in payment_escrow/src/test.rs covering: create, release, refund, unauthorised access rejection

Files to Modify / Create

  • contracts/payment_escrow/src/ (all source files)

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions