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
Copy Markdown
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
Copy Markdown
Contributor

Resolve conflicts

@JerryIdoko
Copy link
Copy Markdown
Contributor

resolve conflicts

@Edoscoba
Copy link
Copy Markdown
Contributor Author

Done @JerryIdoko

@JerryIdoko JerryIdoko merged commit 0643103 into Vesting-Vault:main Feb 26, 2026
1 check failed
Great-2025 pushed a commit to Great-2025/Contracts that referenced this pull request Mar 27, 2026
- Add PathPaymentConfig, PathPaymentClaimEvent, and PathPaymentSimulation types
- Implement configure_path_payment() for admin setup of auto-exit feature
- Add claim_with_path_payment() for instant token-to-USDC swaps in one transaction
- Include simulate_path_payment_claim() for gas-free dry-run simulation
- Add comprehensive test suite covering all path payment scenarios
- Integrate with existing vesting vault infrastructure
- Support custom swap paths and minimum destination amounts
- Include proper error handling and event emission

Resolves Vesting-Vault#146 and Vesting-Vault#93
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