feat(creator-keys): linear vesting with cliff enforcement (#916) - #1009
Closed
Cmitchelle7 wants to merge 6 commits into
Closed
Cmitchelle7 wants to merge 6 commits into
Cmitchelle7 wants to merge 6 commits into
Conversation
|
@Cmitchelle7 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! 🚀 |
Member
|
Conflict |
2 similar comments
Member
|
Conflict |
Member
|
Conflict |
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 #916
Scope
vesting::vested_amount()— pure calculation, zero before cliff, linear release fromstart_timestampoverduration_secs, full allocation once elapsed >= duration.vesting::claimable_amount()— vested minus claimed, floored at zero.vesting::get_vesting_info()— aggregated view (total, vested, claimed, claimable, cliff/start/duration, is_fully_vested) in one call.create_vesting_cliff,claim_vested_cliff,get_vesting_info.DataKey::VestingCliffConfig(creator, beneficiary)storage key (appended per storage-key-invariants.md).VestingCliffClaimedEventemitted on claim.Design decisions
VestingSchedule/create_vesting/claim_vestedtrio, since that feature has no cliff concept and issue Implement linear vesting release calculation with cliff enforcement #916 doesn't ask to replace it. Happy to consolidate if maintainers prefer.duration_secs == 0fully vests exactly at the cliff, to avoid division by zero while still respecting the cliff gate.claim_vested's internal-ledger credit (no SEP-41 transfer in this contract).Validation
No local Rust toolchain available (missing MSVC linker) — CI is the compile/test loop. Unit tests in
vesting.rscover pre-cliff, at-cliff, mid-vesting, fully-vested, zero-duration, zero-allocation, and rounding cases per the issue's acceptance criteria. Integration tests investing_cliff_lifecycle.rscover the create/claim/info lifecycle and duplicate-schedule rejection.