Skip to content

feat(creator-keys): linear vesting with cliff enforcement (#916) - #1009

Closed
Cmitchelle7 wants to merge 6 commits into
accesslayerorg:mainfrom
Cmitchelle7:feat/857-claimable-dividends
Closed

Cmitchelle7 wants to merge 6 commits into
accesslayerorg:mainfrom
Cmitchelle7:feat/857-claimable-dividends

Conversation

@Cmitchelle7

Copy link
Copy Markdown
Contributor

Closes #916

Scope

  • vesting::vested_amount() — pure calculation, zero before cliff, linear release from start_timestamp over duration_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.
  • Contract entrypoints: create_vesting_cliff, claim_vested_cliff, get_vesting_info.
  • New DataKey::VestingCliffConfig(creator, beneficiary) storage key (appended per storage-key-invariants.md).
  • VestingCliffClaimedEvent emitted on claim.

Design decisions

  • Kept as a new, separate schedule type rather than modifying the existing VestingSchedule/create_vesting/claim_vested trio, 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 == 0 fully vests exactly at the cliff, to avoid division by zero while still respecting the cliff gate.
  • Claimed tokens are credited to the beneficiary's key balance via the existing balance/holder_count path, mirroring 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.rs cover pre-cliff, at-cliff, mid-vesting, fully-vested, zero-duration, zero-allocation, and rounding cases per the issue's acceptance criteria. Integration tests in vesting_cliff_lifecycle.rs cover the create/claim/info lifecycle and duplicate-schedule rejection.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Chucks1093

Copy link
Copy Markdown
Member

Conflict

2 similar comments
@Chucks1093

Copy link
Copy Markdown
Member

Conflict

@Chucks1093

Copy link
Copy Markdown
Member

Conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement linear vesting release calculation with cliff enforcement

2 participants