feat(vault): add timelocked parameter update mechanism (#557)#663
Merged
Junirezz merged 2 commits intoMay 31, 2026
Merged
Conversation
Add a propose/execute/cancel timelock pattern for critical vault config changes. Sensitive parameters (fee_bps, min_deposit, large_withdrawal_threshold, min_liquidity_buffer) now require a 48-hour delay between proposal and execution. Changes: - Add ParamKey enum identifying the four critical parameters - Add PendingParamUpdate struct (new_value + unlock_timestamp) - Add PendingParamUpdate(ParamKey) variant to DataKey - Add PARAM_TIMELOCK_DELAY constant (172800s = 48h) - Add three new error codes: NoPendingParamUpdate (12), ParamTimelockNotExpired (13), ParamUpdateAlreadyPending (14) - Add propose_param_update(): admin queues a change with 48h delay - Add execute_param_update(): applies change after timelock expires - Add cancel_param_update(): admin cancels a pending change - Add pending_param_update(): read-only query for pending state - Add 10 tests covering all happy paths and error cases Closes Junirezz#557
|
@OsejiFabian Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Add a propose/execute/cancel timelock pattern for critical vault config changes. Sensitive parameters (fee_bps, min_deposit, large_withdrawal_threshold, min_liquidity_buffer) now require a 48-hour delay between proposal and execution.
Changes:
Closes #557
Pull Request Template
📋 Description
Add a complete environment variable matrix (
docs/ENV_VARIABLE_MATRIX.md) covering every env var consumed across the backend and frontend, with defaults, required flags, and production recommendations. UpdateREADME.mdandENV_QUICK_REFERENCE.mdto link to the new document.🔗 Type of Change
🔒 SECURITY REVIEW (⭐ MANDATORY FOR SMART CONTRACT CHANGES)
For all smart contract code changes, complete the following checklist.
See
docs/SECURITY_CHECKLIST.mdfor detailed guidance.Required: Security Checklist Sign-Off
I have reviewed this PR against the Internal Security Checklist (
docs/SECURITY_CHECKLIST.md)onlyOwner,onlyRole(), etc.)require(success, ...))If any checkbox cannot be verified, explain below:
Slither Static Analysis Results
Ran Slither locally:
slither . --config-file slither.config.jsonGitHub Actions Slither workflow passed:
If this PR has security findings, document them below:
Handling Security Findings
Option A: Fixed in This PR ✅
Option B: False Positive 🟡
contracts/.false-positives.mdwith:Option C: Accepted Risk⚠️
📝 Testing
Functional Testing
Security Testing
For state-changing functions:
For external integrations:
Test Coverage
N/A — documentation only, no executable code added🚀 Deployment Notes
No deployment steps required. This PR adds a Markdown file and updates two existing Markdown files only.
Mainnet Readiness
Breaking Changes
If this PR introduces breaking changes:
[timeframe]📊 Automated Scan Results
Slither Analysis
Related Documentation
✅ Reviewer Checklist
For code reviewers (use this to guide your security-focused review):
📞 Questions or Issues?
docs/SECURITY_CHECKLIST.mddocs/FALSE_POSITIVE_HANDLING.md@security-teamin comments📋 Pre-Submit Checklist
Before marking PR as ready for review:
npm testnpm run lintslither . --config-file slither.config.json✅ Ready for Review? Ensure all items above are checked before requesting review.