Skip to content

Implements Issue #44 by enforcing a maximum vesting duration to prevent overflow/math edge cases.#93

Merged
JerryIdoko merged 7 commits intoVesting-Vault:mainfrom
Edoscoba:issue-44-max-vesting-duration
Feb 26, 2026
Merged

Implements Issue #44 by enforcing a maximum vesting duration to prevent overflow/math edge cases.#93
JerryIdoko merged 7 commits intoVesting-Vault:mainfrom
Edoscoba:issue-44-max-vesting-duration

Conversation

@Edoscoba
Copy link
Contributor

@Edoscoba Edoscoba commented Feb 25, 2026

What changed

  • Defined MAX_DURATION = 315360000 seconds (10 years).
  • Reverts vault creation when (end_time - start_time) > MAX_DURATION (and rejects end_time < start_time) in:
    • create_vault_full
    • create_vault_lazy
    • batch_create_vaults_lazy
    • batch_create_vaults_full
  • Added the same cap to GrantContract::initialize_grant and VestingVault::initialize for consistency across vesting entrypoints.
  • Updated SPEC.md and added tests covering the cap behavior.

Testing

  • cd contracts/vesting_curves && cargo test

Acceptance criteria

  • Define MAX_DURATION = 315360000
  • Revert create_vault if duration > MAX_DURATION

close #70

Issue Vesting-Vault#44: enforce MAX_DURATION=315360000 (10y) and revert on longer schedules.
@JerryIdoko
Copy link
Contributor

Resolve conflicts

@JerryIdoko
Copy link
Contributor

resolve conflicts

@Edoscoba
Copy link
Contributor Author

Done @JerryIdoko

@JerryIdoko JerryIdoko merged commit 0643103 into Vesting-Vault:main Feb 26, 2026
1 check failed
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.

#44 Issue 44: [Logic] Capped Maximum Vesting Duration

2 participants