Standardize Event Specification across Soroban Contracts - #24
Merged
Meshmulla merged 3 commits intoJul 30, 2026
Conversation
- Implemented 4-topic standard hierarchy: [Swipely, Module, Event, ID] - Migrated legacy tuples to strictly typed #[contracttype] structs with versioning (version: u32 = 1) - Refactored env.events().publish in alert_system, escrow_contract, operator_rotation, and governance. - Hooked full proposal lifecycle events in Governance module - Authored centralized EVENTS.md documentation to catalog events - Resolved memory ownership violations during struct initialization - All native unit and integration tests successfully pass
…flect new standardized events
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
To enable reliable off-chain indexing and integrations across the Swipely ecosystem, I have standardized the event emission specification across all Soroban contracts.
The standardization includes:
[symbol_short!("Swipely"), Symbol::new(&env, "Module"), Symbol::new(&env, "EventName"), ID]for easy and performant indexing.#[contracttype]macro, withversion: u32 = 1.Governancemodule (now trackingProposalCreatedEvent,VoteCastEvent,ProposalStatusChangedEvent,ProposalExecutedEvent, etc).EVENTS.mdcataloging the standards and providing clear guidance on event structure for future feature integrations.Components Updated
soroban/src/alert_system.rs: Migrated raw tuples to structured payload events (RuleRegisteredEvent,RuleUpdatedEvent,RuleStatusChangedEvent,AssetEvaluatedEvent).escrow_contract/src/lib.rs: Eliminated legacy symbol-based tuple payloads in favor of standardizedDepositEvent,WithdrawEvent, andFeeUpdatedEvent.soroban/src/operator_rotation.rs: Refactored to emit structuredOperatorAddedEventandOperatorRemovedEvent.soroban/src/governance.rs: Redesigned legacy tuple configurations toParameterChangedEventandConfigUpdatedEvent. Significantly expanded the event hooks across the governance system lifecycle with payload structures for proposal creation, status changes, execution, and vote tracking.Testing & Verification
governance.cargo testand successfully tested all modules including unit/integration suites.soroban/docs/EVENTS.mdcontaining integration logic for developers setting upevent_query.rslisteners.Ready for Review
The Pull Request is fully documented, well-formatted, and completely stable for production deploy. It provides a standardized data lake backbone necessary for any future analytics integrations within the Swipely indexer pipeline.
Closes #3