feat: KYC upload progress, swap fuzz tests, random_gen storage limits revenue batch payouts#671
Open
king-aj-the-first wants to merge 1 commit into
Open
Conversation
…, revenue batch payouts
|
@king-aj-the-first 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.
closes #564
closes #573
closes #582
closes #584
Summary
This PR closes four related issues across the dashboard and Soroban contracts:
random_genrevenue_distributor#584 — Dashboard: KYC upload progress bar
Problem: The KYC tab showed status previews only; there was no document upload flow or upload progress feedback.
Changes:
UploadProgressBar— accessible progress bar (role="progressbar", ARIA attributes) styled to match the dashboard gradient patternKycDocumentUpload— file inputs per document field with per-file upload state (idle→uploading→complete/error)uploadDocumentservice using the SEP-12 presigned URL flow:POST /sep12/customer/upload-urlPUTto presigned URL via axiosonUploadProgressPOST /sep12/customer/upload-confirmFieldRequirementwithtype: 'file'andacceptKycStatusViewwithapiBaseUrl+ walletaccountfromApp.tsxid_photo_front,proof_of_addressFiles:
dashboard/src/components/UploadProgressBar.tsxdashboard/src/components/KycDocumentUpload.tsxdashboard/src/lib/kyc/uploadDocument.tsdashboard/src/components/KycStatusView.tsxdashboard/src/types.tsdashboard/src/App.tsx#564 — Swap contract slippage fuzz tests
Problem: Slippage math lived inline in
MultiAssetSwap::swapwith only one panic-based unit test.Changes:
SwapMathwith checked arithmetic:apply_fee,swap_step_zero_for_one,swap_step_one_for_zeromeets_slippage,calculate_dynamic_fee_bps,simulate_swap_outputproptestintegration suite atcontracts/swap/tests/fuzz_slippage.rscovering:min_amount_out)stdin test builds via#![cfg_attr(not(test), no_std)]#573 — random_gen storage limits review
Problem: min_commits was unbounded; commit/reveal persistent entries were never cleaned up; no operator documentation.
Changes:
Added MAX_PARTICIPANTS = 64 — enforced at initialize and commit
Added storage_limits() view for auditors/operators
Post-finalize cleanup: removes ephemeral Commit / Reveal persistent keys and the Committers vec after seed generation
Added contracts/random_gen/README.md with storage layout, footprint formula, and audit notes
Added tests: test_rejects_excessive_min_commits, test_storage_limits_documented
Footprint (during ceremony): up to 2 × min_commits persistent entries; after finalize only RandomSeed + protocol state remain.
#582 — revenue_distributor payout loop optimization
Problem: Single-token distribute() was O(1), but multi-token payout paths would risk exceeding Soroban instruction limits if implemented as unbounded loops.
Changes:
Extracted distribute_token helper (shared split + transfer logic)
Added register_payout_token (admin) to maintain a token registry
Added distribute_batch(start_index, max_tokens) with MAX_TOKENS_PER_BATCH = 10 cap
Persists PayoutCursor for keeper/off-chain pagination across calls
Added test_distribute_batch_bounded
Usage pattern: keepers call distribute_batch(0, 10), then resume from returned cursor until 0.
Run: