feat: add relock / renew-at-maturity for locked tier vaults [NF-03] - #127
Merged
wumibals merged 8 commits intoJul 19, 2026
Merged
Conversation
|
@michaelsimeon001 is attempting to deploy a commit to the wumibals' projects Team on Vercel. A member of the Team first needs to authorize it. |
- Merge upstream changes: guardian param in vault_l3 initialize, emergency unlock in early_exit, per-asset accounting in vault_router deposit/withdraw/position, allowlist management functions - Keep NF-03 relock feature: relock() in vault_l3 and vault_router, plus relock tests (fixed setup destructuring and ledger API calls) - Add Unauthorized = 5 to VaultError alongside NotYetMatured = 4 - Update ethnum 1.5.0 -> 1.5.3 in Cargo.lock to fix transmute size mismatch build error on stable Rust
wumibals
approved these changes
Jul 19, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
relock(user)onvault_l3,vault_l6, andvault_l12, plus aVaultRouter.relock(user, tier)passthrough, allowing depositors to renew their lock at maturity in a single transaction — no withdraw/redeposit cycle required.Changes
Per locked vault (vault_l3, vault_l6, vault_l12)
NotYetMatured = 4error variant toVaultErrorLOCK_DURATIONconstant for clarityrelock(user: Address) -> u32:NotYetMaturedifcurrent_ledger < lock_untilLockUntil = current_ledger + LOCK_DURATIONin placeBalance,Shares, orCheckpointlock_untilvault_router
relock(user: Address, tier: Tier) -> u32passthroughrelockfunctionTests
Each vault's test file gains three new tests:
test_relock_at_maturity_sets_new_lock_untiltest_relock_does_not_change_balance_or_sharestest_relock_before_maturity_is_rejected(#[should_panic(expected = "NotYetMatured")])Router tests cover relock routing for L3/L6/L12 and the Flex panic.
Acceptance Criteria
relockbeforelock_until→ rejected withNotYetMaturedrelockafter maturity → newlock_until = current_ledger + LOCK_DURATIONrelockdoes not changeBalanceorSharescloses #78