You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
Overview
The
payment_escrowcontract atcontracts/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
no_std)contracts/common_types/src/types.rsaccess_controlcontract governs who can trigger releases and refunds@stellar/stellar-sdkinbackend/src/payments/providers/soroban-escrow.provider.tsTasks
create_escrow(booking_id, amount, member_address, hub_address, unlock_date)— creates escrow, stores state in contract storagerelease(escrow_id, caller)— callable only by hub address oraccess_controladmin; transfers funds to hub addressrefund(escrow_id, caller)— callable only beforeunlock_dateor when a cancellation flag is set; returns funds to memberget_escrow(escrow_id)— read-only view of escrow state (amount, status, parties)payment_escrow/src/test.rscovering: create, release, refund, unauthorised access rejectionFiles to Modify / Create
contracts/payment_escrow/src/(all source files)