Skip to content

feat: add graded schedule#399

Open
0xNeshi wants to merge 2 commits into
feat/vesting-walletfrom
feat/vesting-wallet-graded
Open

feat: add graded schedule#399
0xNeshi wants to merge 2 commits into
feat/vesting-walletfrom
feat/vesting-wallet-graded

Conversation

@0xNeshi

@0xNeshi 0xNeshi commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Towards #156

Opened as separate PR from #395 for easier and focused review just on the schedule logic.

@0xNeshi 0xNeshi self-assigned this Jun 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 11:59
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f70357d-d6a0-4a68-92b3-f0cf4ef9431b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vesting-wallet-graded

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new graded (unequal tranche) vesting schedule implementation for the existing vesting_wallet primitive, extending the finance package with a “cumulative bps at offsets” staircase curve and a dedicated test suite.

Changes:

  • Added vesting_wallet_graded schedule module exposing new / create_and_share / vested_amount / release / releasable / destroy plus view helpers.
  • Implemented graded curve evaluation as a stage-based staircase using cumulative basis points with overflow guards and u128-backed mul_div.
  • Added comprehensive unit tests covering constructor validation, curve shape, release behavior, destroy gating, and overflow boundaries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
contracts/finance/sources/vesting_wallet_graded.move New graded schedule module implementing stage-based cumulative-bps vesting on top of vesting_wallet.
contracts/finance/tests/vesting_wallet_graded_tests.move New test suite validating graded schedule construction, vesting math, release semantics, and teardown rules.

Comment on lines +146 to +148
let n = offsets_ms.length();
assert!(n > 0, EEmptySchedule);
assert!(cumulative_bps.length() == n, ELengthMismatch);
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.

2 participants