Skip to content

Add player safety and payment modules for the quest economy - #388

Merged
Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
ayshadogo:feature/player-safety-and-payment-modules
Nov 19, 2026
Merged

Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
ayshadogo:feature/player-safety-and-payment-modules

Conversation

@ayshadogo

Copy link
Copy Markdown
Contributor

Summary

This PR adds four Soroban contracts covering all open issues assigned to @ayshadogo. Each contract follows the repository's existing conventions: #[contracttype] storage keys, typed #[contracterror] errors, event publishing and colocated unit tests.

#379 - Spending Limit Module for Player Accounts

  • Per-account SpendingConfig with daily and per-transaction caps.
  • Rolling daily spend tracking keyed by ledger day, so caps reset on schedule.
  • Increases are queued as PendingLimit and only take effect after a configurable delay through apply_pending.
  • Decreases apply immediately and cancel any pending increase.
  • Vault based deposit / withdraw / spend flow rejects any transfer above either cap.

#380 - Dispute Bond for Puzzle Reports

  • file_report locks a bond and opens a report with Open status.
  • The admin or a configured moderation panel can resolve a report exactly once.
  • Upheld refunds the bond to the reporter; Rejected forfeits it to the treasury.
  • Reports record the final status and resolver, and repeat resolution is rejected.

#381 - Token Streaming Payments

  • Streams capture sender, recipient, token, rate, start/end, funded total and withdrawals.
  • Accrual is computed from ledger time and capped at the funded total and the effective end (including cancellation).
  • withdraw and withdraw_all can never exceed the accrued balance.
  • cancel splits the unstreamed remainder between sender and recipient using basis points, while already accrued funds remain withdrawable.
  • The current recipient can hand off a stream with change_recipient.

#382 - Puzzle Unlock Keys

  • Registrable key types with admin and authorized-minter roles.
  • mint to players, transfer between players and burn when a key is consumed.
  • Balances and total supply are tracked per key type.

Test coverage

Unit tests were added for every contract: cap enforcement and daily reset, delayed increases and immediate decreases, bond refund/forfeit and single resolution, accrual math and withdrawal bounds, cancellation settlement, recipient handoff, key transfers and per-type supply. No builds, installs, CI or test commands were run locally, per the contribution instructions.

Closes #379
Closes #380
Closes #381
Closes #382

@drips-wave

drips-wave Bot commented Nov 19, 2026

Copy link
Copy Markdown

@ayshadogo 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

Implement four Soroban contracts covering the assigned issues:

- MindFlowInteractive#379 spending_limit: per-account daily and per-transaction caps, rolling daily spend tracking, delayed limit increases and immediate decreases
- MindFlowInteractive#380 dispute_bond: bonds locked on report filing, admin/panel resolution, refund on upheld and forfeiture to treasury on rejected
- MindFlowInteractive#381 token_streaming: accrual from ledger time, capped withdrawals, cancellation with remainder split, and recipient handoff
- MindFlowInteractive#382 unlock_keys: admin/authorized minting, player-to-player transfers, burning and per-key-type supply tracking

Closes MindFlowInteractive#379
Closes MindFlowInteractive#380
Closes MindFlowInteractive#381
Closes MindFlowInteractive#382
@Mkalbani
Mkalbani merged commit 83ad4da into MindFlowInteractive:main Nov 19, 2026
1 check 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.

Puzzle Unlock Keys Token Streaming Payments Dispute Bond for Puzzle Reports Spending Limit Module for Player Accounts

2 participants