fix: resolve merge conflict, structured config keys, admin events, do…#328
Merged
hman38705 merged 2 commits intoMar 27, 2026
Merged
Conversation
…uble-refund guard - solutions-plug#183: resolve types.rs merge conflict to enable winner_counts field; count_bets_for_outcome now reads market.winner_counts per outcome - solutions-plug#184: add DataKey::Config(ConfigKey) variant in markets.rs; route get/set_creation_deposit through DataKey::Config to avoid key collisions - solutions-plug#185: emit rep_set and dep_set events with old+new values from set_creator_reputation and set_creation_deposit - solutions-plug#186: apply CEI in release_creation_deposit — zero creation_deposit and persist before token transfer to prevent double-refund
|
@manuelusman73-png Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
fix: analytics stub, config key collisions, admin events, double-refund guard (#183–186)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Summary
This PR resolves four issues across types.rs, markets.rs, and events.rs.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#183 — Fix broken count_bets_for_outcome analytics
The Market struct had an unresolved merge conflict in types.rs that stripped the winner_counts: Map<u32, u32> field introduced by the
fix/issue-24-precise-winner-tracking branch. This prevented compilation and left count_bets_for_outcome non-functional. The conflict is resolved by keeping the
winner_counts field. A second conflict in OracleConfig (duplicate struct definition with an Option variant leaking below the markers) is also cleaned up.
#184 — Structured DataKey::Config(ConfigKey) for creation deposit storage
get_creation_deposit and set_creation_deposit were using ConfigKey::CreationDeposit directly as a storage key alongside DataKey::MarketCount in the same
persistent store. Since Soroban serializes #[contracttype] enums by discriminant index, two different enum types with overlapping discriminants can collide. A
Config(ConfigKey) variant is added to markets.rs's local DataKey enum and both functions are updated to route through it.
#185 — Emit events for administrative state changes
set_creator_reputation and set_creation_deposit performed silent state mutations with no on-chain trace. Two new emit functions are added to events.rs (rep_set,
dep_set), each carrying both the old and new values. Both setters now read the current value before writing and emit after a successful store.
#186 — Prevent double-refund in release_creation_deposit
The function transferred creation_deposit tokens but never zeroed the field, allowing repeated calls to drain the contract. Fixed by applying strict Checks-
Effects-Interactions: market.creation_deposit is set to 0 and persisted via update_market before the token_client.transfer call. Subsequent calls hit
creation_deposit == 0 and skip the transfer entirely.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Files changed
Closes #183
Closes #184
Closes #185
Closes #186