Skip to content

[Feature]: Soroban Contract Error & Event Standardization #191

Description

@SudiptaPaul-31

🔍 Problem Statement

Description

Standardize contract errors and events so the frontend and backend can reliably interpret blockchain operations. This ensures consistent handling of failures and predictable event-driven workflows across the application.


Requirements

  • Define custom contract errors — clear, descriptive error codes/messages for invalid actions.
  • Standardize event names — consistent naming convention across all contract events.
  • Include relevant identifiers in events — e.g., contract ID, milestone ID, actor wallet.
  • Document event payloads — specify schema for each event type to aid integration.

Examples

  • EscrowCreated — emitted when a new escrow contract is initialized.
  • EscrowFunded — funds deposited into escrow.
  • MilestoneSubmitted — freelancer submits milestone deliverable.
  • MilestoneApproved — client approves milestone.
  • PaymentReleased — funds released to freelancer.
  • DisputeRaised — client raises a dispute.
  • RefundIssued — funds refunded to client.

Tasks

  • Create error enum — define reusable error codes (e.g., ERR_UNAUTHORIZED, ERR_INVALID_STATE).
  • Implement event emission — ensure every critical action emits a standardized event.
  • Add identifiers to payloads — include contract/milestone IDs and actor wallet addresses.
  • Write documentation — event schemas, error codes, and usage guidelines.
  • Add contract tests — verify events and errors are emitted consistently.

Acceptance Criteria

  • Invalid actions return standardized errors — frontend/backend can interpret reliably.
  • Events follow consistent naming convention — no ambiguity across contracts.
  • Event payloads include identifiers — consumers can trace actions to contracts/milestones.
  • Documentation available — developers can integrate without guesswork.
  • Tests cover all events and errors — ensuring reliability and consistency.

📈 Expected Impact

High — Would significantly improve user experience

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions