Skip to content

Add non-linear vesting curve support (step and exponential) selectable per VestingSchedule #448

Description

@thlpkee20-wq

Description

Straight-line vesting is a single curve. Tokenized revenue-share offerings often need step (monthly bucket) or exponential back-loaded schedules. Add a VestingCurve enum and route vested_amount_at through a curve evaluator while keeping linear as default.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: Revora-Contracts/src/vesting.rs
  • Curve evaluation must use only i128 fixed-point math, no floats

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/vesting-curves
  • Implement changes
    • Define VestingCurve { Linear, Step { period_secs: u64 }, Exponential { k_num: u32, k_den: u32 } }
    • Add evaluate_curve(curve, elapsed, total) helper with checked arithmetic
    • Persist curve into VestingSchedule and migrate existing schedules to Linear
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Exponential with k_den=0 must fail with InvalidCurveParameters
  • Include test output and security notes

Example commit message

feat: add Step and Exponential vesting curves

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions