Skip to content

Commit 79bc432

Browse files
committed
chore: add v1.14.0 core upgrade scripts
1 parent 08275bb commit 79bc432

8 files changed

Lines changed: 350 additions & 339 deletions

File tree

script/releases/CoreContractsDeployer.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ import "./Env.sol";
1616
abstract contract CoreContractsDeployer is EOADeployer {
1717
using Env for *;
1818

19+
/// @dev Runs a release test only for core deployments below the target version.
20+
modifier onlyIfUpgradeRequired(
21+
string memory targetVersion
22+
) {
23+
if (Env.isCoreProtocolDeployed() && !Env._versionGte(Env.envVersion(), targetVersion)) {
24+
_;
25+
}
26+
}
27+
1928
/// permissions/
2029
function deployPermissionController() internal onlyEOA returns (PermissionController deployed) {
2130
deployed = new PermissionController();

script/releases/v1.13.0-slash-resolution-delay/1-deployImplementations.s.sol

Lines changed: 0 additions & 84 deletions
This file was deleted.

script/releases/v1.13.0-slash-resolution-delay/3-completeUpgrade.s.sol

Lines changed: 0 additions & 175 deletions
This file was deleted.

script/releases/v1.13.0-slash-resolution-delay/upgrade.json

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.12;
3+
4+
import "../Env.sol";
5+
import "../TestUtils.sol";
6+
import {CoreContractsDeployer} from "../CoreContractsDeployer.sol";
7+
import {EmissionsController} from "src/contracts/core/EmissionsController.sol";
8+
9+
/// Purpose: Deploy implementations for the v1.14.0 EigenPod disable
10+
/// and emissions burn release.
11+
contract DeployImplementations is CoreContractsDeployer {
12+
using Env for *;
13+
14+
/// @notice Catch up environments that are still missing the v1.12.0 incentive council deployment.
15+
function _needsIncentiveCouncilUpgrade() internal view returns (bool) {
16+
return !Env._versionGte(Env.envVersion(), "1.12.0");
17+
}
18+
19+
function _runAsEOA() internal virtual override {
20+
vm.startBroadcast();
21+
22+
if (_needsIncentiveCouncilUpgrade()) {
23+
_deployEmissionsControllerProxy();
24+
zUpdateUint32("REWARDS_COORDINATOR_MAX_REWARDS_DURATION", 63_072_000);
25+
deployRewardsCoordinator();
26+
}
27+
28+
deployDelegationManager();
29+
deployEigenPodManager();
30+
deployEigenPod();
31+
deployEmissionsController();
32+
33+
vm.stopBroadcast();
34+
}
35+
36+
function _deployEmissionsControllerProxy() internal onlyEOA {
37+
deployProxy({
38+
name: type(EmissionsController).name,
39+
deployedTo: address(
40+
ITransparentUpgradeableProxy(
41+
payable(new TransparentUpgradeableProxy({
42+
_logic: address(Env.impl.emptyContract()),
43+
admin_: Env.proxyAdmin(),
44+
_data: ""
45+
}))
46+
)
47+
)
48+
});
49+
}
50+
51+
function testScript() public virtual onlyIfUpgradeRequired("1.14.0") {
52+
runAsEOA();
53+
54+
TestUtils.validateDelegationManagerImmutables(Env.impl.delegationManager());
55+
TestUtils.validateDelegationManagerInitialized(Env.impl.delegationManager());
56+
TestUtils.validateDelegationManagerVersion();
57+
58+
TestUtils.validateEigenPodManagerImmutables(Env.impl.eigenPodManager());
59+
TestUtils.validateEigenPodManagerInitialized(Env.impl.eigenPodManager());
60+
TestUtils.validateEigenPodImmutables(Env.impl.eigenPod());
61+
62+
TestUtils.validateEmissionsControllerImmutables(Env.impl.emissionsController());
63+
TestUtils.validateEmissionsControllerInitialized(Env.impl.emissionsController());
64+
65+
if (_needsIncentiveCouncilUpgrade()) {
66+
TestUtils.validateRewardsCoordinatorImmutables(Env.impl.rewardsCoordinator());
67+
TestUtils.validateRewardsCoordinatorInitialized(Env.impl.rewardsCoordinator());
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)