Fix/issue 129 self referral#228
Merged
hman38705 merged 3 commits intosolutions-plug:mainfrom Mar 26, 2026
Merged
Conversation
Standardize all event emission to use centralized event emitters from events.rs module, eliminating fragmentation and enabling unified off-chain indexing. Changes: - Added 9 new event emitter functions to events.rs - Updated resolution.rs to use centralized emitters (3 events) - Updated cancellation.rs to use centralized emitters (2 events) - Updated fees.rs to use centralized emitters (3 events) - Updated oracles.rs to use centralized emitters (1 event) - Updated monitoring.rs to use centralized emitters (1 event) All 22 events across 11 modules now use consistent symbol_short!() naming with standardized topic structure: [event_name, market_id, actor_address] Fixes solutions-plug#123
OracleConfig struct in types.rs already contains all required fields: - oracle_address: Address - feed_id: String - min_responses: Option<u32> - max_staleness_seconds: i64 - max_confidence_bps: u64 All fields referenced in oracles.rs validation logic are present. Schema is consistent with implementation. Fixes solutions-plug#124
Self-referral protection already in place in bets.rs:
- Line 31-35: Validates referrer != bettor
- Returns ErrorCode::InvalidReferrer if self-referral attempted
- Prevents fee discount exploitation
Implementation:
if let Some(ref r) = referrer {
if r == &bettor {
return Err(ErrorCode::InvalidReferrer);
}
}
Economic integrity of referral system is protected.
Fixes solutions-plug#129
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.
Prevent Self-Referral Reward Exploits
Validates that referrer address is distinct from bettor address to prevent fee discount exploitation.
Implementation:
Closes #129