Context
Payment requests can remain open indefinitely, leading to stale data, accounting confusion, and potential price exposure in volatile markets.
Current Limitation/Problem
Payment requests have no expiration mechanism. A request created at a specific exchange rate may be fulfilled days later at a very different rate, causing disputes.
Expected Outcome
Time-bound payment requests enforced both at the smart contract level (for on-chain payments) and backend level (for off-chain). Expired requests are automatically voided with proper event emissions.
Acceptance Criteria
- Configurable expiration per request (minutes, hours, days)
- Soroban contract enforces expiration during payment execution
- EVM contract enforces expiration for on-chain payments
- Backend rejects expired requests before relaying to chain
- Automatic status transition: pending -> expired
- Notification to requester and payer on expiration
- Expired request renewal with new rate calculation
- Dashboard filtering for expired requests
Technical Scope
contracts/soroban/payment-request/src/ - expiration logic in Soroban
contracts/evm/payment-request/src/ - expiration logic in EVM
backend/src/services/payments/expiration.ts - backend enforcement
- Prisma:
PaymentRequest add expiresAt, expiredAt fields
- BullMQ cron for expiration checking
- Frontend: expiration display and renewal UI
- Edge cases: block timestamp manipulation, timezone handling, grace periods
Context
Payment requests can remain open indefinitely, leading to stale data, accounting confusion, and potential price exposure in volatile markets.
Current Limitation/Problem
Payment requests have no expiration mechanism. A request created at a specific exchange rate may be fulfilled days later at a very different rate, causing disputes.
Expected Outcome
Time-bound payment requests enforced both at the smart contract level (for on-chain payments) and backend level (for off-chain). Expired requests are automatically voided with proper event emissions.
Acceptance Criteria
Technical Scope
contracts/soroban/payment-request/src/- expiration logic in Sorobancontracts/evm/payment-request/src/- expiration logic in EVMbackend/src/services/payments/expiration.ts- backend enforcementPaymentRequestaddexpiresAt,expiredAtfields