Skip to content

feat: add batch withdraw support to stealth sender - #145

Open
pharwasz wants to merge 6 commits into
wraith-protocol:developfrom
pharwasz:feat/withdraw-many-batch
Open

feat: add batch withdraw support to stealth sender#145
pharwasz wants to merge 6 commits into
wraith-protocol:developfrom
pharwasz:feat/withdraw-many-batch

Conversation

@pharwasz

Copy link
Copy Markdown

Summary

This PR adds batch withdrawal support to the stealth-sender contract by introducing a new withdraw_many entrypoint. The implementation enables multiple withdrawals to be processed atomically in a single transaction while enforcing a maximum batch size and emitting both per-withdrawal and aggregate events.

Changes

  • Added withdraw_many to the stealth-sender contract.

  • Enforced a maximum batch size of 30 withdrawals.

  • Leveraged Soroban transaction atomicity so any failed withdrawal reverts the entire batch.

  • Emitted Withdrawn events for each successful withdrawal and a BatchWithdrawn event for the overall operation.

  • Added integration tests covering:

    • Successful batch withdrawals.
    • Atomic rollback when a withdrawal in the batch fails.
  • Updated performance documentation with benchmark results for 1, 10, and 30 entry batches.

  • Updated snapshots to reflect the new functionality.

Testing

  • ✅ Contract unit tests passed.
  • ✅ Integration tests passed.
  • ✅ Verified atomic rollback behavior when a withdrawal in the batch fails.
  • ✅ Confirmed event emission for both individual withdrawals and batch completion.
  • ✅ Verified optimized WASM remains well below the 110 KB limit.

If your repository uses GitHub's issue-closing keywords, append this to the bottom:

Closes #120

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

otobongdev and others added 5 commits July 27, 2026 15:17
…uturenet (wraith-protocol#139)

Adds stellar/scripts/deploy-dryrun.sh - self-contained script that deploys all four Wraith contracts to futurenet, wires them, runs smoke tests, and prints IDs with stellar.expert links. Idempotent via deterministic deploy salts. Includes DEPLOYMENT.md docs and CI nightly schedule job.

Co-authored-by: Alaps <qozeemibrahim065@gmail.com>
…otocol#140)

Add a cargo-bench harness that compares N stealth-sender::send calls against
one stealth-batch-sender::batch_send for N in {1,2,5,10,15,20}, records
instruction gas and wall-clock, and documents the N=1 crossover in PERF.md.

Closes 121

Co-authored-by: Cursor <cursoragent@cursor.com>
…ith-protocol#141)

Add rotate_signers flow to stealth-sender and wraith-names (the two
Timelock + Multisig Upgradable contracts per GOVERNANCE.md), gated by
quorum approval from current signers plus a 7-day timelock matching
the existing upgrade timelock. Invalid thresholds (zero, or greater
than the proposed signer count) are rejected with a dedicated error.
Execution emits SignersRotated; cancellation fully clears pending
proposal state so a new rotation can be proposed immediately.

Update MULTISIG.md with the on-chain rotation runbook. Futurenet
rehearsal is called out as a follow-up since it requires a live
deployment.

Closes wraith-protocol#104

Co-authored-by: OpadijoIdris <Opadijoayomipo@gmail.com>
@pharwasz
pharwasz force-pushed the feat/withdraw-many-batch branch from d03bca6 to 1b2169a Compare July 27, 2026 14:46
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.

Withdrawal batching for stealth-sender

5 participants