Skip to content

Comments

logic to switch math based on the curve type.#53

Merged
JerryIdoko merged 1 commit intoVesting-Vault:mainfrom
BigJohn-dev:feature/linearVesting
Feb 23, 2026
Merged

logic to switch math based on the curve type.#53
JerryIdoko merged 1 commit intoVesting-Vault:mainfrom
BigJohn-dev:feature/linearVesting

Conversation

@BigJohn-dev
Copy link
Contributor

Closes #6

Summary

Adds a VestingCurve enum to the Vesting Vault contract, enabling Linear (proportional) and Exponential (slow-start, fast-finish) vesting schedules. The curve is immutable after initialization, with updated logic in vested_amount, claim, and status, plus full unit and integration test coverage.

Key Updates

  • Linear: total × elapsed ÷ duration
  • Exponential: total × elapsed² ÷ duration²
  • Curve set at initialize() and cannot change
  • Incremental claims handled correctly
  • 11 tests covering math and behavior

Testing

Run cargo test (all 11 should pass), build with stellar contract build, deploy, initialize with either curve, and verify 50% elapsed returns 50% (Linear) or 25% (Exponential).


@JerryIdoko JerryIdoko merged commit a6a0a4d into Vesting-Vault:main Feb 23, 2026
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.

# Issue: [Logic] Support Linear vs. Exponential Vesting

2 participants