Skip to content

feat(contracts): implement mystery box with pity timer (#396) - #410

Merged
Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
nuvoraxis:feat/396-mystery-box-pity-timer
Nov 21, 2026
Merged

Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
nuvoraxis:feat/396-mystery-box-pity-timer

Conversation

@nuvoraxis

Copy link
Copy Markdown

Summary of Changes

This pull request implements the Mystery Box with Pity Timer Soroban smart contract module as specified in #396.

Key Capabilities

  • Weighted Tier Distribution: Supports Common, Uncommon, and Rare tiers with configurable weights.
  • Pity Timer Guarantee: Tracks consecutive non-rare opens per player. Once the configurable threshold is reached, a Rare reward is guaranteed on the next open.
  • Counter Invariant: Any Rare reward (natural roll or pity-forced) strictly resets the player's pity counter back to 0.
  • Safety & Auditing: Publishes structured Soroban events on each opening, and records per-player and global box opening metrics.
  • Admin Configuration: Admin can adjust pity threshold and reward weights with strict validity checks.

Testing & Verification

  • Validated via cargo check --package mystery-box against Soroban SDK v21.
  • Unit tests included in src/test.rs.

Closes #396

…active#396)

- Implement configurable reward tiers (Common, Uncommon, Rare) and weight distribution
- Add verifiable pseudo-random selection bounded by weights
- Implement per-player pity counter guaranteeing rare reward at threshold
- Automatically reset pity counter upon receiving rare reward
- Provide admin controls for threshold and weight configuration
- Add unit tests and module documentation

Resolves MindFlowInteractive#396
@Mkalbani
Mkalbani merged commit 9abb712 into MindFlowInteractive:main Nov 21, 2026
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.

Mystery Box with Pity Timer

2 participants