Skip to content

[GF-03] Implement Locked Vault Trio (VaultL3, VaultL6, VaultL12)#58

Merged
wumibals merged 1 commit into
LadderMine:mainfrom
SharifIbrahimDev:feat/gf-03-vault-trio
Jun 19, 2026
Merged

[GF-03] Implement Locked Vault Trio (VaultL3, VaultL6, VaultL12)#58
wumibals merged 1 commit into
LadderMine:mainfrom
SharifIbrahimDev:feat/gf-03-vault-trio

Conversation

@SharifIbrahimDev

@SharifIbrahimDev SharifIbrahimDev commented Jun 19, 2026

Copy link
Copy Markdown

Description

This PR implements the three time-locked vault contracts (VaultL3, VaultL6, VaultL12) to fulfill issue #36.

Since the contracts/shared crate from GF-01 (#34) has not been merged yet, I embedded the required fixed-point math (mul_fp) and the Checkpoint storage key logic internally inside each vault as a mock setup to avoid blocking the implementation. These can be refactored to use the shared crate once GF-01 is merged.

Key Changes

  • VaultL3: 3-month lock (777,600 ledgers), 1.05x multiplier, 0.50% exit fee, 50 USDC min deposit.
  • VaultL6: 6-month lock (1,555,200 ledgers), 1.15x multiplier, 1.25% exit fee, 100 USDC min deposit.
  • VaultL12: 12-month lock (3,110,400 ledgers), 1.40x multiplier, 3.00% exit fee, 250 USDC min deposit.
  • Deposit Flow: Validates min deposit, scales shares using mul_fp against the tier multiplier, sets LockUntil, sets the deposit_ledger + 1 checkpoint, and forwards capital to StrategyVault.
  • Withdraw Flow: Asserts the lock duration has expired, burns shares, and cleans up the persistent storage keys.
  • Early Exit Flow: Calculates the tier-specific exit fee using mul_fp, deducts it from the principal, and socialises the fee by leaving the capital inside the StrategyVault to increase the pro-rata value of all remaining shares.
  • Tests: Comprehensive test coverage including tests for deposit logic, lock panics, successful withdrawals at maturity, and early exit fee calculations.

Closes #36

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the wumibals' projects Team on Vercel.

A member of the Team first needs to authorize it.

@wumibals wumibals merged commit 6cbb5c8 into LadderMine:main Jun 19, 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.

[GF-03] [CONTRACT] Locked Vault Trio (VaultL3 + VaultL6 + VaultL12): Full Implementation + Tests

2 participants