-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0.0] slashing upgrade script #916
Open
jbrower95
wants to merge
19
commits into
slashing-magnitudes
Choose a base branch
from
jb/slashing-upgrade
base: slashing-magnitudes
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
428d52d
rebase + readd changes
jbrower95 8e36341
fix build
jbrower95 62b0167
deploy skeleton
wadealexc b6f777a
more scaffolding
jbrower95 4b5597c
deploy skeleton finished
wadealexc b4cf590
fix: ops and executor are also pausers
wadealexc 33cef75
feat: upgrade script skeleton
wadealexc 5ff9263
zDeployedInstanceCount + zDeployedInstance
jbrower95 ba97aa1
fix: reset submodule and exec call naming
wadealexc 3d7b68c
deploy script abstractions
wadealexc 5703c73
refactor: zeus lookups
wadealexc fd31b0a
chore: remove commented out line
wadealexc 3392f3e
fix: use env to get new impl
wadealexc 3c98b5e
upgrade lib/zeus-templates
jbrower95 54a892d
refactor: encoding
wadealexc a2934d9
chore: correct environment vars
wadealexc d50695e
[zeus] script phase: "complete all checkpoints" upgrade script for sl…
jbrower95 28dab59
feat: clean up pranking
wadealexc 14aef29
feat: implement pause and execution steps and start testing
wadealexc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule zeus-templates
updated
76 files
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,266 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.12; | ||
|
||
import "forge-std/Vm.sol"; | ||
import "zeus-templates/utils/ZEnvHelpers.sol"; | ||
|
||
import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol"; | ||
|
||
/// core/ | ||
import "src/contracts/core/AllocationManager.sol"; | ||
import "src/contracts/core/AVSDirectory.sol"; | ||
import "src/contracts/core/DelegationManager.sol"; | ||
import "src/contracts/core/RewardsCoordinator.sol"; | ||
import "src/contracts/core/StrategyManager.sol"; | ||
|
||
/// permissions/ | ||
import "src/contracts/permissions/PauserRegistry.sol"; | ||
import "src/contracts/permissions/PermissionController.sol"; | ||
|
||
/// pods/ | ||
import "src/contracts/pods/EigenPod.sol"; | ||
import "src/contracts/pods/EigenPodManager.sol"; | ||
|
||
/// strategies/ | ||
import "src/contracts/strategies/EigenStrategy.sol"; | ||
import "src/contracts/strategies/StrategyBase.sol"; | ||
import "src/contracts/strategies/StrategyBaseTVLLimits.sol"; | ||
import "src/contracts/strategies/StrategyFactory.sol"; | ||
|
||
library Env { | ||
|
||
using ZEnvHelpers for *; | ||
|
||
/// Dummy types and variables to facilitate syntax, e.g: `Env.proxy.delegationManager()` | ||
enum DeployedProxy { A } | ||
enum DeployedImpl { A } | ||
enum DeployedInstance { A } | ||
|
||
DeployedProxy internal constant proxy = DeployedProxy.A; | ||
DeployedImpl internal constant impl = DeployedImpl.A; | ||
DeployedInstance internal constant instance = DeployedInstance.A; | ||
|
||
/** | ||
* env | ||
*/ | ||
|
||
function executorMultisig() internal view returns (address) { | ||
return _envAddress("executorMultisig"); | ||
} | ||
|
||
function opsMultisig() internal view returns (address) { | ||
return _envAddress("operationsMultisig"); | ||
} | ||
|
||
function protocolCouncilMultisig() internal view returns (address) { | ||
return _envAddress("protocolCouncilMultisig"); | ||
} | ||
|
||
function pauserMultisig() internal view returns (address) { | ||
return _envAddress("pauserMultisig"); | ||
} | ||
|
||
function proxyAdmin() internal view returns (address) { | ||
return _envAddress("proxyAdmin"); | ||
} | ||
|
||
function ethPOS() internal view returns (IETHPOSDeposit) { | ||
return IETHPOSDeposit(_envAddress("ethPOS")); | ||
} | ||
|
||
function timelockController() internal view returns (TimelockController) { | ||
return TimelockController(payable(_envAddress("timelockController"))); | ||
} | ||
|
||
function multiSendCallOnly() internal view returns (address) { | ||
return _envAddress("MultiSendCallOnly"); | ||
} | ||
|
||
function EIGENPOD_GENESIS_TIME() internal view returns (uint64) { | ||
return _envU64("EIGENPOD_GENESIS_TIME"); | ||
} | ||
|
||
function MIN_WITHDRAWAL_DELAY() internal view returns (uint32) { | ||
return _envU32("MIN_WITHDRAWAL_DELAY"); | ||
} | ||
|
||
function ALLOCATION_CONFIGURATION_DELAY() internal view returns (uint32) { | ||
return _envU32("ALLOCATION_CONFIGURATION_DELAY"); | ||
} | ||
|
||
function CALCULATION_INTERVAL_SECONDS() internal view returns (uint32) { | ||
return _envU32("REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS"); | ||
} | ||
|
||
function MAX_REWARDS_DURATION() internal view returns (uint32) { | ||
return _envU32("REWARDS_COORDINATOR_MAX_REWARDS_DURATION"); | ||
} | ||
|
||
function MAX_RETROACTIVE_LENGTH() internal view returns (uint32) { | ||
return _envU32("REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH"); | ||
} | ||
|
||
function MAX_FUTURE_LENGTH() internal view returns (uint32) { | ||
return _envU32("REWARDS_COORDINATOR_MAX_FUTURE_LENGTH"); | ||
} | ||
|
||
function GENESIS_REWARDS_TIMESTAMP() internal view returns (uint32) { | ||
return _envU32("REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP"); | ||
} | ||
|
||
/** | ||
* core/ | ||
*/ | ||
|
||
function allocationManager(DeployedProxy) internal view returns (AllocationManager) { | ||
return AllocationManager(_deployedProxy(type(AllocationManager).name)); | ||
} | ||
|
||
function allocationManager(DeployedImpl) internal view returns (AllocationManager) { | ||
return AllocationManager(_deployedImpl(type(AllocationManager).name)); | ||
} | ||
|
||
function avsDirectory(DeployedProxy) internal view returns (AVSDirectory) { | ||
return AVSDirectory(_deployedProxy(type(AVSDirectory).name)); | ||
} | ||
|
||
function avsDirectory(DeployedImpl) internal view returns (AVSDirectory) { | ||
return AVSDirectory(_deployedImpl(type(AVSDirectory).name)); | ||
} | ||
|
||
function delegationManager(DeployedProxy) internal view returns (DelegationManager) { | ||
return DelegationManager(_deployedProxy(type(DelegationManager).name)); | ||
} | ||
|
||
function delegationManager(DeployedImpl) internal view returns (DelegationManager) { | ||
return DelegationManager(_deployedImpl(type(DelegationManager).name)); | ||
} | ||
|
||
function rewardsCoordinator(DeployedProxy) internal view returns (RewardsCoordinator) { | ||
return RewardsCoordinator(_deployedProxy(type(RewardsCoordinator).name)); | ||
} | ||
|
||
function rewardsCoordinator(DeployedImpl) internal view returns (RewardsCoordinator) { | ||
return RewardsCoordinator(_deployedImpl(type(RewardsCoordinator).name)); | ||
} | ||
|
||
function strategyManager(DeployedProxy) internal view returns (StrategyManager) { | ||
return StrategyManager(_deployedProxy(type(StrategyManager).name)); | ||
} | ||
|
||
function strategyManager(DeployedImpl) internal view returns (StrategyManager) { | ||
return StrategyManager(_deployedImpl(type(StrategyManager).name)); | ||
} | ||
|
||
/** | ||
* permissions/ | ||
*/ | ||
|
||
function pauserRegistry(DeployedImpl) internal view returns (PauserRegistry) { | ||
return PauserRegistry(_deployedImpl(type(PauserRegistry).name)); | ||
} | ||
|
||
function permissionController(DeployedProxy) internal view returns (PermissionController) { | ||
return PermissionController(_deployedProxy(type(PermissionController).name)); | ||
} | ||
|
||
function permissionController(DeployedImpl) internal view returns (PermissionController) { | ||
return PermissionController(_deployedImpl(type(PermissionController).name)); | ||
} | ||
|
||
/** | ||
* pods/ | ||
*/ | ||
|
||
function eigenPod(DeployedProxy) internal view returns (EigenPod) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm. this is gross. makes it weird to treat a beacon the same way as TUPs... I need to read thru zeus |
||
return EigenPod(payable(_deployedProxy(type(EigenPod).name))); | ||
} | ||
|
||
function eigenPod(DeployedImpl) internal view returns (EigenPod) { | ||
return EigenPod(payable(_deployedImpl(type(EigenPod).name))); | ||
} | ||
|
||
function eigenPodManager(DeployedProxy) internal view returns (EigenPodManager) { | ||
return EigenPodManager(_deployedProxy(type(EigenPodManager).name)); | ||
} | ||
|
||
function eigenPodManager(DeployedImpl) internal view returns (EigenPodManager) { | ||
return EigenPodManager(_deployedImpl(type(EigenPodManager).name)); | ||
} | ||
|
||
/** | ||
* strategies/ | ||
*/ | ||
|
||
function eigenStrategy(DeployedProxy) internal view returns (EigenStrategy) { | ||
return EigenStrategy(_deployedProxy(type(EigenStrategy).name)); | ||
} | ||
|
||
function eigenStrategy(DeployedImpl) internal view returns (EigenStrategy) { | ||
return EigenStrategy(_deployedImpl(type(EigenStrategy).name)); | ||
} | ||
|
||
// Beacon proxy | ||
function strategyBase(DeployedProxy) internal view returns (StrategyBase) { | ||
return StrategyBase(_deployedProxy(type(StrategyBase).name)); | ||
} | ||
|
||
// Beaconed impl | ||
function strategyBase(DeployedImpl) internal view returns (StrategyBase) { | ||
return StrategyBase(_deployedImpl(type(StrategyBase).name)); | ||
} | ||
|
||
// Returns the number of proxy instances | ||
function strategyBaseTVLLimits_Count(DeployedInstance) internal view returns (uint) { | ||
return _deployedInstanceCount(type(StrategyBaseTVLLimits).name); | ||
} | ||
|
||
// Returns the proxy instance at index `i` | ||
function strategyBaseTVLLimits(DeployedInstance, uint i) internal view returns (StrategyBaseTVLLimits) { | ||
return StrategyBaseTVLLimits(_deployedInstance(type(StrategyBaseTVLLimits).name, i)); | ||
} | ||
|
||
function strategyBaseTVLLimits(DeployedImpl) internal view returns (StrategyBaseTVLLimits) { | ||
return StrategyBaseTVLLimits(_deployedImpl(type(StrategyBaseTVLLimits).name)); | ||
} | ||
|
||
function strategyFactory(DeployedProxy) internal view returns (StrategyFactory) { | ||
return StrategyFactory(_deployedProxy(type(StrategyFactory).name)); | ||
} | ||
|
||
function strategyFactory(DeployedImpl) internal view returns (StrategyFactory) { | ||
return StrategyFactory(_deployedImpl(type(StrategyFactory).name)); | ||
} | ||
|
||
/** | ||
* Helpers | ||
*/ | ||
|
||
function _deployedInstance(string memory name, uint idx) private view returns (address) { | ||
return ZEnvHelpers.state().deployedInstance(name, idx); | ||
} | ||
|
||
function _deployedInstanceCount(string memory name) private view returns (uint) { | ||
return ZEnvHelpers.state().deployedInstanceCount(name); | ||
} | ||
|
||
function _deployedProxy(string memory name) private view returns (address) { | ||
return ZEnvHelpers.state().deployedProxy(name); | ||
} | ||
|
||
function _deployedImpl(string memory name) private view returns (address) { | ||
return ZEnvHelpers.state().deployedImpl(name); | ||
} | ||
|
||
function _envAddress(string memory key) private view returns (address) { | ||
return ZEnvHelpers.state().envAddress(key); | ||
} | ||
|
||
function _envU64(string memory key) private view returns (uint64) { | ||
return ZEnvHelpers.state().envU64(key); | ||
} | ||
|
||
function _envU32(string memory key) private view returns (uint32) { | ||
return ZEnvHelpers.state().envU32(key); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed entirely and also from EigenPod.sol itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear we removed this though way back