feat: add graded schedule#399
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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_gradedschedule module exposingnew/create_and_share/vested_amount/release/releasable/destroyplus 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. |
| let n = offsets_ms.length(); | ||
| assert!(n > 0, EEmptySchedule); | ||
| assert!(cumulative_bps.length() == n, ELengthMismatch); |
Towards #156
Opened as separate PR from #395 for easier and focused review just on the schedule logic.