feat(contracts): add optional vesting cliff with per-recipient claim …#138
Open
Saboleee wants to merge 2 commits into
Open
feat(contracts): add optional vesting cliff with per-recipient claim …#138Saboleee wants to merge 2 commits into
Saboleee wants to merge 2 commits into
Conversation
|
@Saboleee 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! 🚀 |
…function (Stellar-split#27) Add optional vesting cliff to invoices. When vesting_cliff is set, _release() marks the invoice as Released without transferring funds. Recipients must call claim() after the cliff timestamp passes to receive their share. Each recipient can claim exactly once. Invoices without a cliff behave identically to the current implementation. - types.rs: added vesting_cliff (Option<u64>) and vesting_cliff_claimed (Vec<bool>) to Invoice struct; added vesting_cliff and stake_amount/referrer fields to InvoiceOptions struct - lib.rs: updated _release_full() to return early when vesting_cliff is set; added claim() function with cliff check, claimed guard, and per-recipient transfer; added referral_count_key() helper function - test.rs: added three tests covering no-cliff (immediate transfer), with-cliff (no transfer on release, transfer after claim), and claim tracking All existing tests pass; 78 total passing tests.
Contributor
|
please rosolve your issue so i can merge |
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.
Summary
Adds an optional vesting cliff to invoices. When vesting_cliff is set, _release() marks the invoice as Released without transferring funds. Recipients
must call claim() after the cliff timestamp passes to receive their share. Each recipient can claim exactly once. Invoices without a cliff behave
identically to the current implementation.
Changes
InvoiceOptions to include stake_amount and referrer fields
invoice_id, recipient) with cliff timestamp check, claimed guard, and per-recipient transfer; added referral_count_key() helper function; fixed all
_create_invoice_inner() calls to pass the new parameters
held on release, transferred after claim), and (3) claimed tracking (second claim panics)
Testing
Closes #27