Severity: MEDIUM — No Dispute Resolution Capability
Problem
The escrow contract at contract/soroban/contracts/escrow/src/lib.rs is a placeholder hello() function. The technical guide lists it as one of the 4 core Soroban contracts responsible for dispute resolution.
Without it, there is no on-chain mechanism to handle:
- Payer disputes (wrong amount, not received)
- Partial refunds from escrow
- Multi-party fund holding during dispute window
Implementation Required
```rust
pub struct EscrowContract;
pub struct EscrowEntry {
pub payer: Address,
pub merchant: Address,
pub arbiter: Address, // Useroutr relay
pub token: Address,
pub amount: i128,
pub payment_id: Bytes,
pub state: EscrowState,
pub created_at: u64,
pub release_at: u64, // auto-release after dispute window
}
pub enum EscrowState { Locked, Released, Disputed, Refunded, PartialRefund }
impl EscrowContract {
pub fn lock(env, payer, merchant, arbiter, token, amount, payment_id, release_at) -> BytesN<32>
pub fn release(env, escrow_id) // arbiter or auto after release_at
pub fn dispute(env, escrow_id) // payer opens dispute
pub fn resolve(env, escrow_id, payer_bps, merchant_bps) // arbiter splits funds
pub fn auto_release(env, escrow_id) // anyone can call after release_at
pub fn get_escrow(env, escrow_id) -> EscrowEntry
}
```
Acceptance Criteria
Severity: MEDIUM — No Dispute Resolution Capability
Problem
The escrow contract at
contract/soroban/contracts/escrow/src/lib.rsis a placeholderhello()function. The technical guide lists it as one of the 4 core Soroban contracts responsible for dispute resolution.Without it, there is no on-chain mechanism to handle:
Implementation Required
```rust
pub struct EscrowContract;
pub struct EscrowEntry {
pub payer: Address,
pub merchant: Address,
pub arbiter: Address, // Useroutr relay
pub token: Address,
pub amount: i128,
pub payment_id: Bytes,
pub state: EscrowState,
pub created_at: u64,
pub release_at: u64, // auto-release after dispute window
}
pub enum EscrowState { Locked, Released, Disputed, Refunded, PartialRefund }
impl EscrowContract {
pub fn lock(env, payer, merchant, arbiter, token, amount, payment_id, release_at) -> BytesN<32>
pub fn release(env, escrow_id) // arbiter or auto after release_at
pub fn dispute(env, escrow_id) // payer opens dispute
pub fn resolve(env, escrow_id, payer_bps, merchant_bps) // arbiter splits funds
pub fn auto_release(env, escrow_id) // anyone can call after release_at
pub fn get_escrow(env, escrow_id) -> EscrowEntry
}
```
Acceptance Criteria
Locked,Released,Disputed,Resolved,AutoReleased