feat: add timelock for upgrades#145
Open
RonTuretzky wants to merge 1 commit intoBreadchainCoop:devfrom
Open
Conversation
Implement UpgradeTimelock contract to enforce time delays on proxy upgrades, addressing issue BreadchainCoop#132. This ensures upgrades can only go through after a configurable timelock period for enhanced security. ## Changes - Add UpgradeTimelock contract extending OpenZeppelin TimelockController - Add deployment script with environment variable configuration - Add upgrade management script for scheduling/executing through timelock - Add comprehensive test suite covering timelock functionality - Implement role-based access control (proposers, executors, admin) - Add helper functions for deterministic operation IDs and status checking ## Security Features - Minimum delay enforcement (default 24 hours) - Role separation between proposers and executors - Cancellation capability for scheduled operations - Full compatibility with existing TransparentUpgradeableProxy pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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 timelock functionality for proxy upgrades as requested in issue #132. This adds a mandatory time delay between proposing and executing upgrades, significantly enhancing the security of the upgrade process.
Changes
✅ Core Implementation
src/UpgradeTimelock.sol)TimelockControllerUpgradeable✅ Deployment & Scripts
Deployment Script (
script/deploy/DeployUpgradeTimelock.s.sol)Upgrade Management (
script/upgrades/TimelockUpgrade.s.sol)✅ Testing
test/UpgradeTimelock.t.sol)Security Features
Usage
Test Results
Addresses Issue #132
This implementation fully addresses the requirement to "ensure upgrades can only go through after a timelock" by:
🤖 Generated with Claude Code