feat(crowdfund): add affiliate system with comprehensive tests#401
Closed
davidugorji wants to merge 2 commits into
Closed
feat(crowdfund): add affiliate system with comprehensive tests#401davidugorji wants to merge 2 commits into
davidugorji wants to merge 2 commits into
Conversation
|
@davidugorji 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! 🚀 |
…ests Soroban testutils events().all() is scoped to the most recent contract invocation; an extra read call between the event-emitting call and the assertion cleared the events buffer, causing events.len()-1 to overflow. Closes ShadeProtocol#351
Author
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.
Adds a per-campaign affiliate system to crowdfund: organizer-managed affiliate registration, commission rate config, commission accrual on referred pledges, and commission claiming.
What's added
set_affiliate_commission_bps,register_affiliate,is_affiliate(organizer-only management)contribute_with_affiliate(referred pledge, accrues commission),affiliate_balanceclaim_affiliate_commissioncontracts/crowdfund/src/tests/test_feature_214.rscovering commission config validation, registration (incl. unauthorized/duplicate/rollback-on-panic), contribution happy path with exact event-argument assertions, unregistered-affiliate rejection with rollback verification, multi-contributor accrual, rounding-to-zero edge case, and claim lifecycle (incl. double-claim rollback).Note: pushing a follow-up commit shortly to fix a build issue (two new contractevent struct names exceeded the 32-char Symbol limit) and finish full test verification.
Closes #351