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
This issue aims to address the implementation of Structured Contract Events with Indexed Topics across Escrow, Reputation & Loyalty.
The core objective is to: Publish a consistent, documented event on every state-changing contract operation, with topics chosen so an off-chain indexer can filter by appointment, worker, or address without scanning every ledger.
By completing this feature, we will ensure that the GuildWorkman protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the Smart Contract architecture and adherence to the existing project conventions.
When picking up this issue, please ensure you document any new dependencies or architectural decisions made during development.
Component
Smart Contracts (Soroban)
Difficulty
🟡 Medium
Current state
None of the three contracts publishes a single event — grep -rn "events()" contracts/*/src/lib.rs returns nothing. Escrow funding, completion, cancellation, dispute, reputation submission, and loyalty mint/transfer/burn all mutate state invisibly.
That directly blocks the on-chain ingestion pipeline in #22, which has nothing to ingest, and it means the only way to learn a contract's state today is to poll get_appointment for every id the backend already knows about. Events are the small change that unblocks the larger one.
Tasks
Review the existing Soroban workspace under soroban-contracts/contracts/
Implement the contract logic for: Structured Contract Events with Indexed Topics across Escrow, Reputation & Loyalty
Publish an event from every state-changing entry point in escrow (create, confirm, cancel, dispute, resolve), reputation (review submitted), and loyalty-token (mint, transfer, burn, approve, minter rotation)
Choose topic tuples deliberately so an indexer can filter by appointment_id, worker address, or account without a full scan — document the topic layout per event
Follow SEP-41 conventions for the loyalty token's events so standard tooling recognizes them
Keep event payloads small and typed; do not emit unbounded String data
Write comprehensive unit and integration tests, including adversarial edge cases — assert emitted events via the test env's event recorder, and assert that failed operations emit nothing
Add caching for cargo dependencies in CI
Run cargo fmt --check and cargo clippy -- -D warnings
Run cargo test and soroban contract build to verify the optimized WASM build
Acceptance Criteria
Feature accurately implements the objective: Publish a consistent, documented event on every state-changing contract operation, with topics chosen so an off-chain indexer can filter by appointment, worker, or address without scanning every ledger.
Every state-changing entry point across all three contracts emits exactly one event
An operation that fails and returns an Error emits no event
Topic layout supports filtering by appointment id and by address, demonstrated in tests
Description
This issue aims to address the implementation of Structured Contract Events with Indexed Topics across Escrow, Reputation & Loyalty.
The core objective is to: Publish a consistent, documented event on every state-changing contract operation, with topics chosen so an off-chain indexer can filter by appointment, worker, or address without scanning every ledger.
By completing this feature, we will ensure that the GuildWorkman protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the Smart Contract architecture and adherence to the existing project conventions.
When picking up this issue, please ensure you document any new dependencies or architectural decisions made during development.
Component
Smart Contracts (Soroban)
Difficulty
🟡 Medium
Current state
None of the three contracts publishes a single event —
grep -rn "events()" contracts/*/src/lib.rsreturns nothing. Escrow funding, completion, cancellation, dispute, reputation submission, and loyalty mint/transfer/burn all mutate state invisibly.That directly blocks the on-chain ingestion pipeline in #22, which has nothing to ingest, and it means the only way to learn a contract's state today is to poll
get_appointmentfor every id the backend already knows about. Events are the small change that unblocks the larger one.Tasks
soroban-contracts/contracts/escrow(create, confirm, cancel, dispute, resolve),reputation(review submitted), andloyalty-token(mint, transfer, burn, approve, minter rotation)appointment_id, worker address, or account without a full scan — document the topic layout per eventStringdatacargo fmt --checkandcargo clippy -- -D warningscargo testandsoroban contract buildto verify the optimized WASM buildAcceptance Criteria
Erroremits no eventEstimated Time
1-2 days