feat: Implement comprehensive event emission system#185
Merged
greatest0fallt1me merged 4 commits intoOct 5, 2025
Conversation
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Contributor
Author
|
@greatest0fallt1me please review |
Contributor
|
@pushkarm029 One step away from merge! Can you handle the conflicts? |
Resolved conflict in events.rs by merging both sets of changes: - Kept event emission implementations (StateChangeEvent, WinningsClaimedEvent) - Kept upgrade manager events (ContractUpgradedEvent, ContractRollbackEvent, UpgradeProposalCreatedEvent) Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Contributor
Author
|
@greatest0fallt1me resolved |
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.
Pull Request Description
📋 Basic Information
Type of Change
Related Issues
Closes #86
Priority Level
📝 Detailed Description
What does this PR do?
Implements a comprehensive event emission system for the Predictify prediction market contract. Adds complete event tracking for all critical contract operations including market creation, voting, oracle results, disputes, fee collection, state changes, winnings claims, and error events.
Why is this change needed?
The contract previously lacked a systematic event emission infrastructure. This prevented:
How was this tested?
🏗️ Smart Contract Specific
Contract Changes
Oracle Integration
Market Resolution Logic
Security Considerations
🧪 Testing
Test Coverage
Test Results
📚 Documentation
Documentation Updates
🔍 Code Quality
Code Review Checklist
Performance Impact
📊 Impact Assessment
User Impact
✅ Final Checklist
Pre-Submission
Review Readiness
🔗 Implementation Details
Files Modified:
contracts/predictify-hybrid/src/events.rs- Added StateChangeEvent, WinningsClaimedEvent, and 3 new emission functionscontracts/predictify-hybrid/src/lib.rs- Integrated events in create_market(), vote(), claim_winnings(), resolve_market_manual()contracts/predictify-hybrid/src/resolution.rs- Added event emissions for market resolution and oracle resultscontracts/predictify-hybrid/src/disputes.rs- Added dispute creation event emissioncontracts/predictify-hybrid/src/fees.rs- Added fee collection event emissionNew Event Types:
StateChangeEvent- Tracks market state transitionsWinningsClaimedEvent- Tracks user payout claimsNew Functions:
emit_state_change_event()- Emits on state transitionsemit_winnings_claimed()- Emits on winnings claimsemit_error_event()- Error tracking with full contextEvent Integration Points:
create_market()vote()claim_winnings()resolve_market_manual()resolve_market()fetch_oracle_result()process_dispute()collect_fees()💬 Notes for Reviewers
Please pay special attention to:
Thank you for your contribution to Predictify! 🚀