Skip to content

feat: make stake_on_call participant-aware - #370

Merged
PeterOche merged 1 commit into
degenspot:mainfrom
Meet-hybrid:fix/317-stake-on-call-participant-dedup
Sep 1, 2026
Merged

feat: make stake_on_call participant-aware#370
PeterOche merged 1 commit into
degenspot:mainfrom
Meet-hybrid:fix/317-stake-on-call-participant-dedup

Conversation

@Meet-hybrid

Copy link
Copy Markdown
Contributor

Overview

Make stake_on_call position-aware for multi-outcome calls by validating the selected pool and counting each staker only once per call.

Related Issue

Closes #317

Changes

🎯 Position-Aware Call Staking

  • [MODIFY] Deduplicate participant_count across all UserStake outcome entries for the same staker and call.
  • [MODIFY] Use checked participant-count arithmetic to prevent silent overflow.
  • [ADD] Cover a repeat staker selecting a second outcome in the multi-outcome test while preserving all pool and stake totals.
  • [PRESERVE] Existing pause, settlement, end-time, outcome-index, SAC transfer, surge-fee, vault, event, and persistent-TTL behavior.

Verification Results

cargo fmt --manifest-path packages/contracts-stellar/call_registry/Cargo.toml -- --check
✅ passed

git diff --check
✅ passed

cargo test --manifest-path packages/contracts-stellar/call_registry/Cargo.toml
⚠️ blocked: the environment could not resolve index.crates.io while fetching rand
Acceptance Criteria Status
Multi-staker, three-outcome pools remain correct ✅ Existing multi-outcome coverage retained and extended
participant_count is not double-counted ✅ Checks all per-outcome UserStake entries before incrementing
Paused contract blocks staking ✅ Existing pause guard preserved

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@Meet-hybrid 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! 🚀

Learn more about application limits

@PeterOche

Copy link
Copy Markdown
Contributor

@Meet-hybrid your pr is failing checks, please fix

@Meet-hybrid
Meet-hybrid force-pushed the fix/317-stake-on-call-participant-dedup branch from 0840c95 to 2b05cdf Compare September 1, 2026 00:30
@PeterOche
PeterOche merged commit 96528be into degenspot:main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SC-004 — Position-Aware stake_on_call with Outcome Index Validation

2 participants