Skip to content

docs: add vesting wallet examples#400

Merged
0xNeshi merged 16 commits into
feat/vesting-walletfrom
feat/vesting-wallet-examples
Jun 22, 2026
Merged

docs: add vesting wallet examples#400
0xNeshi merged 16 commits into
feat/vesting-walletfrom
feat/vesting-wallet-examples

Conversation

@0xNeshi

@0xNeshi 0xNeshi commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Towards #156
Updates PR #395

PR Checklist

  • Tests
  • Documentation
  • Changelog

@0xNeshi 0xNeshi self-assigned this Jun 19, 2026
Copilot AI review requested due to automatic review settings June 19, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jun 19, 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: 742bc718-27ee-49b0-b988-2195a636b727

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-examples

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

@0xNeshi 0xNeshi changed the title Feat/vesting wallet examples docs: add vesting wallet examples Jun 19, 2026

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

Adds integration examples for the openzeppelin_finance vesting wallet, and wires those examples into the finance package documentation so downstream users have concrete patterns to follow.

Changes:

  • Link contracts/README.md and contracts/finance/README.md to new vesting wallet integration examples.
  • Add three example Move modules demonstrating: a custom schedule curve (vesting_quadratic), a curve-agnostic pausable wrapper (pausable_grant), and a beneficiary-as-object payout splitter (splitter).
  • Add unit tests validating the examples’ end-to-end composition and key invariants.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
contracts/README.md Adds a pointer to the finance vesting wallet examples directory.
contracts/finance/README.md Introduces an “Examples” section documenting the new integration patterns and links.
contracts/finance/examples/vesting_wallet/vesting_quadratic.move Implements a quadratic vesting curve module intended for direct composition with vesting_wallet.
contracts/finance/examples/vesting_wallet/pausable_grant.move Adds a generic, curve-agnostic pausable wrapper around VestingWallet.
contracts/finance/examples/vesting_wallet/splitter.move Adds a Beneficiary splitter object that disperses received payouts by weight.
contracts/finance/examples/vesting_wallet/tests/vesting_quadratic_tests.move Tests composing the quadratic schedule with the core wallet lifecycle and invariants.
contracts/finance/examples/vesting_wallet/tests/pausable_grant_tests.move Tests pause/resume behavior and admin-cap binding for the wrapper pattern.
contracts/finance/examples/vesting_wallet/tests/splitter_tests.move Tests weighted fan-out behavior and rounding conservation for the beneficiary-as-object pattern.

Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/splitter.move

@bidzyyys bidzyyys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread contracts/finance/examples/vesting_wallet/splitter.move Outdated
Copilot AI review requested due to automatic review settings June 22, 2026 08:58

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

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/tests/splitter_tests.move
Comment thread contracts/finance/examples/vesting_wallet/tests/splitter_tests.move
Copilot AI review requested due to automatic review settings June 22, 2026 11:01

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 12 comments.

Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/tests/splitter_tests.move
Comment thread contracts/finance/examples/vesting_wallet/tests/splitter_tests.move
Comment thread contracts/finance/examples/vesting_wallet/tests/splitter_tests.move
Comment thread contracts/finance/examples/vesting_wallet/tests/vesting_quadratic_tests.move Outdated
Comment thread contracts/finance/examples/vesting_wallet/tests/vesting_quadratic_tests.move Outdated
Comment thread contracts/finance/examples/vesting_wallet/tests/vesting_quadratic_tests.move Outdated
Comment thread contracts/finance/examples/vesting_wallet/tests/pausable_grant_tests.move Outdated
Copilot AI review requested due to automatic review settings June 22, 2026 11:14

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

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

Comment thread contracts/finance/examples/vesting_wallet/splitter.move

@ericnordelo ericnordelo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good, left a couple of small comments.

Comment thread contracts/finance/examples/vesting_wallet/tests/vesting_quadratic_tests.move Outdated
Comment thread contracts/finance/README.md Outdated
Copilot AI review requested due to automatic review settings June 22, 2026 13:50

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/splitter.move
Comment thread contracts/finance/examples/vesting_wallet/pausable_grant.move
@0xNeshi 0xNeshi merged commit 25cf95f into feat/vesting-wallet Jun 22, 2026
7 checks passed
@0xNeshi 0xNeshi deleted the feat/vesting-wallet-examples branch June 22, 2026 14:02
0xNeshi added a commit that referenced this pull request Jun 22, 2026
* feat: add openzeppelin_finance package & vesting_wallet module scaffold

* feat: implement vesting wallet and linear schedule

* feat: move start & duration to linear params + general improvements

* fix: available > VestedAmount now takes S type

* fix: add module witness to destroy_empty

* fix: add missing witness to destroy fun

* feat: assert schedule doesn't overflow on new

* feat: remove params param from mint_vested + add wallet_id to VestedAmount

* docs: update schedule_params comment

* docs: add short explanatory comments for vested amount type

* docs: update vested amount invariant comment

* docs: update documentation

* tests: add

* test: remove traces

* docs: change em dash into dash

* test: revert teardown change in rate limiter

* test: add additional probing

* docs: fix typo in invariants

* ref: assert wallet not ended before destroying

* fix: assert deposit cannot brick the release path

* docs: run code quality skill

* feat: rename EOverflow->EBalanceOverflow

* feat: add custom error for insufficient balance on release

* test: update tests with new error changes

* feat: implement stepped schedule

* docs: add SAFETY comment to elapsed_steps calc

* ref: use std::u64::mul_div in linear for vested calc

* ref: use std::u64::mul_div in stepped for vested calc + remove math/core dep

* feat: rename x_schedule->vesting_wallet_x

* feat: merge linear and stepped schedules

* test: fmt + remove test_only

* ci: run contracts/finance package in CI matrix

Register the new finance package in the CI package matrix so it is built,
linted, and tested. Document the requirement in CONTRIBUTING.md so new
packages get wired into CI in the same PR.

* test: inline teardown

* build: add addresses field to Move.toml

* ref: remove vesting-wallet-artifacts

* feat: add witness gated set_schedule_params

* docs: update README

* test: add missing edge test cases

* docs: mention curve-agnostic protocols use case

* feat: zero coin deposit emits no event

* test: cover zero deposit, owned receive, and pre-open releasable views

* feat: add beneficiary requirement for destroying

* feat: add params ctors

* chore: Update CHANGELOG with new vesting wallet modules

Added new vesting wallet modules to the changelog.

* ref: Refactor destroy function parameters for mutability

* docs: align with styleguide

* docs: clarify type params for vw new

* refactor: apply STYLEGUIDE.md (finance)

- Drop the stray empty '// === Imports ===' header (matches access/utils,
  whose first delimiter is '// === Errors ===').
- Rename test section '// === Test helpers ===' to '// === Test-Only Helpers ==='.
- Remove the unused 'Scenario' import alias.

* feat: make destroy curve-agnostic even when used through wrappers (#404)

* feat: rework destroy to be curve-agnostic

* docs: reorder todo

* feat: remove set_schedule_params

* test: fix tests

* fix: update implementation + fix docs

* feat: add _ms suffix to time-related getters

* docs: fix refs

* ref: use oz math for mul_div

* ref: add new lines between errors

* docs: fix wording re: Params being witness and note on why only beneficiary destroys

* remove scratchpad

* docs: remove mention of OZ Solidity mirro

* feat: add create_and_share_continuous

* docs: add vesting wallet examples (#400)

* ref: add &mut to destroy in linear

* chore: changelog

* docs: add examples

* docs: link examples in READMEs

* ref: use openzeppelin_math::u64::mul_div instead of std

* docs: add missing tests and SAFETY note in splitter

* docs: use it_address

* docs: use method syntax

* docs: remove cap mention for pausable grant in readme

* test: use destroy instead of destroy_for_testing

* docs: format

* docs: quadratic > destroy accepts &mut TxContext

* docs: document create_and_share_continuous in finance README

---------

Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com>
Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com>
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.

4 participants