fix(batch-processor): implement real batched token transfers - #474
Open
johnbiliyaminu-bit wants to merge 1 commit into
Open
fix(batch-processor): implement real batched token transfers#474johnbiliyaminu-bit wants to merge 1 commit into
johnbiliyaminu-bit wants to merge 1 commit into
Conversation
Replace the arithmetic-only stub with a genuine batch transfer contract. Previous implementation: - Took only Vec<u64> amounts, no addresses or token - Summed amounts with checked_add and returned the total - Contained dead state-version race-condition checks (always snapshot+1 under Soroban's single-transaction, non-reentrant model) - Contained dead re-entrancy guard (redundant given Soroban's execution model) - Emitted no transfers despite the contract name and BatchTooLarge error New implementation: - Signature: process_batch(env, funder, token, recipients, amounts) - funder.require_auth() called before any token movement - Validates lengths match, batch <= 100, all amounts > 0 - Accumulates total in one pass, pulls a single lump sum from funder, then fans out to each recipient individually - Error enum: LengthMismatch=1, BatchTooLarge=2, InvalidAmount=3, ArithmeticOverflow=4 Closes conduit-protocol#248, conduit-protocol#104, conduit-protocol#246
|
@johnbiliyaminu-bit 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.
Replace the arithmetic-only stub with a genuine batch transfer contract.
Previous implementation:
New implementation:
Closes #248, #104, #246
What does this PR do?
Type of change
Related issue
Closes #
Changes
Checklist
cargo fmt --all— no diffcargo clippy --all-targets -- -D warnings— zero warningscargo test --all— all tests passchecked_*methodsrequire_auth()called before any state mutation in modified functionsCHANGELOG.mdupdated under[Unreleased]docs/architecture.mdupdated if design changedSecurity notes
Testing notes
closes #361