Skip to content

[Contract] Emit structured events for all state transitions #5

Description

@Gbangbolaoluwagbemiga

Overview

Off-chain indexers and frontend real-time updates depend on contract events. Currently the contract emits no structured events — it's impossible to reliably stream escrow state changes.

Events to add

Event Trigger
`EscrowCreated { escrow_id, depositor, total_amount, token }` `create_escrow`
`WorkStarted { escrow_id, freelancer }` `start_work`
`MilestoneSubmitted { escrow_id, index }` `submit_milestone`
`MilestoneApproved { escrow_id, index, amount_released }` `approve_milestone`
`MilestoneRejected { escrow_id, index, reason }` `reject_milestone`
`DisputeRaised { escrow_id, index, raised_by }` dispute path
`DisputeResolved { escrow_id, index, freelancer_amount }` admin resolve
`EscrowCompleted { escrow_id }` final approval
`EscrowRefunded { escrow_id, amount }` refund paths
`FreelancerRated { escrow_id, rating }` `rate_freelancer`

Acceptance criteria

  • All 10 events emitted correctly using `env.events().publish()`
  • Event structs use `contracttype` derive (ABI-exported)
  • Unit tests assert events emitted via `env.events().all()`

Good first issue: Start with just `EscrowCreated` and open a draft PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contractSoroban / Rust smart contract workenhancementNew feature or improvementgood first issueWelcoming to new contributors

    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