Skip to content

Commit dcd304d

Browse files
committed
fix: rebase
1 parent 31cd1b1 commit dcd304d

File tree

3 files changed

+13
-27
lines changed

3 files changed

+13
-27
lines changed

script/releases/v1.10.0-rewards-v2.2/1-deployRewardsCoordinatorImpl.s.sol

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity ^0.8.12;
33

44
import {EOADeployer} from "zeus-templates/templates/EOADeployer.sol";
55
import "../Env.sol";
6+
import "../TestUtils.sol";
67

78
/**
89
* @title DeployRewardsCoordinatorImpl
@@ -13,6 +14,7 @@ import "../Env.sol";
1314
*/
1415
contract DeployRewardsCoordinatorImpl is EOADeployer {
1516
using Env for *;
17+
using TestUtils for *;
1618

1719
/// forgefmt: disable-next-item
1820
function _runAsEOA() internal override {
@@ -38,8 +40,7 @@ contract DeployRewardsCoordinatorImpl is EOADeployer {
3840
MAX_REWARDS_DURATION: Env.MAX_REWARDS_DURATION(),
3941
MAX_RETROACTIVE_LENGTH: Env.MAX_RETROACTIVE_LENGTH(),
4042
MAX_FUTURE_LENGTH: 63072000, // 730 days (2 years)
41-
GENESIS_REWARDS_TIMESTAMP: Env.GENESIS_REWARDS_TIMESTAMP(),
42-
version: Env.deployVersion()
43+
GENESIS_REWARDS_TIMESTAMP: Env.GENESIS_REWARDS_TIMESTAMP()
4344
})
4445
)
4546
)
@@ -63,14 +64,13 @@ contract DeployRewardsCoordinatorImpl is EOADeployer {
6364
_validateProxyAdmin();
6465
_validateImplConstructor();
6566
_validateImplInitialized();
66-
_validateVersion();
6767
_validateNewFunctionality();
6868
_validateStorageLayout();
6969
}
7070

7171
/// @dev Validate that the new RewardsCoordinator impl address is distinct from the current one
7272
function _validateNewImplAddress() internal view {
73-
address currentImpl = Env._getProxyImpl(address(Env.proxy.rewardsCoordinator()));
73+
address currentImpl = TestUtils._getProxyImpl(address(Env.proxy.rewardsCoordinator()));
7474
address newImpl = address(Env.impl.rewardsCoordinator());
7575

7676
assertFalse(currentImpl == newImpl, "RewardsCoordinator impl should be different from current implementation");
@@ -81,20 +81,15 @@ contract DeployRewardsCoordinatorImpl is EOADeployer {
8181
address pa = Env.proxyAdmin();
8282

8383
assertTrue(
84-
Env._getProxyAdmin(address(Env.proxy.rewardsCoordinator())) == pa, "RewardsCoordinator proxyAdmin incorrect"
84+
TestUtils._getProxyAdmin(address(Env.proxy.rewardsCoordinator())) == pa, "RewardsCoordinator proxyAdmin incorrect"
8585
);
8686
}
8787

8888
/// @dev Validate the immutables set in the new RewardsCoordinator implementation constructor
8989
function _validateImplConstructor() internal view {
9090
RewardsCoordinator rewardsCoordinatorImpl = Env.impl.rewardsCoordinator();
9191

92-
// Validate version
93-
assertEq(
94-
keccak256(bytes(rewardsCoordinatorImpl.version())),
95-
keccak256(bytes(Env.deployVersion())),
96-
"RewardsCoordinator impl version mismatch"
97-
);
92+
// Note: version() function has been removed in this upgrade
9893

9994
// Validate core dependencies
10095
assertTrue(
@@ -152,14 +147,6 @@ contract DeployRewardsCoordinatorImpl is EOADeployer {
152147
);
153148
}
154149

155-
/// @dev Validate the version is correctly set
156-
function _validateVersion() internal view {
157-
assertEq(
158-
keccak256(bytes(Env.impl.rewardsCoordinator().version())),
159-
keccak256(bytes(Env.deployVersion())),
160-
"RewardsCoordinator version should match deploy version"
161-
);
162-
}
163150

164151
/// @dev Validate new Rewards v2.2 functionality
165152
function _validateNewFunctionality() internal view {

script/releases/v1.10.0-rewards-v2.2/2-queueRewardsCoordinatorUpgrade.s.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity ^0.8.12;
33

44
import {DeployRewardsCoordinatorImpl} from "./1-deployRewardsCoordinatorImpl.s.sol";
55
import "../Env.sol";
6+
import "../TestUtils.sol";
67

78
import {MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol";
89
import {MultisigCall, Encode} from "zeus-templates/utils/Encode.sol";
@@ -20,6 +21,7 @@ import {TimelockController} from "@openzeppelin/contracts/governance/TimelockCon
2021
contract QueueRewardsCoordinatorUpgrade is MultisigBuilder, DeployRewardsCoordinatorImpl {
2122
using Env for *;
2223
using Encode for *;
24+
using TestUtils for *;
2325

2426
function _runAsMultisig() internal virtual override prank(Env.opsMultisig()) {
2527
if (!(Env.isSourceChain() && Env._strEq(Env.envVersion(), "1.9.0"))) {
@@ -103,7 +105,7 @@ contract QueueRewardsCoordinatorUpgrade is MultisigBuilder, DeployRewardsCoordin
103105
RewardsCoordinator rewardsCoordinator = Env.proxy.rewardsCoordinator();
104106

105107
// Validate current implementation is different from new implementation
106-
address currentImpl = Env._getProxyImpl(address(rewardsCoordinator));
108+
address currentImpl = TestUtils._getProxyImpl(address(rewardsCoordinator));
107109
address newImpl = address(Env.impl.rewardsCoordinator());
108110
assertTrue(currentImpl != newImpl, "Current and new implementations should be different");
109111

script/releases/v1.10.0-rewards-v2.2/3-executeRewardsCoordinatorUpgrade.s.sol

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pragma solidity ^0.8.12;
33

44
import "../Env.sol";
5+
import "../TestUtils.sol";
56
import {QueueRewardsCoordinatorUpgrade} from "./2-queueRewardsCoordinatorUpgrade.s.sol";
67
import {Encode} from "zeus-templates/utils/Encode.sol";
78

@@ -16,6 +17,7 @@ import {Encode} from "zeus-templates/utils/Encode.sol";
1617
contract ExecuteRewardsCoordinatorUpgrade is QueueRewardsCoordinatorUpgrade {
1718
using Env for *;
1819
using Encode for *;
20+
using TestUtils for *;
1921

2022
function _runAsMultisig() internal override prank(Env.protocolCouncilMultisig()) {
2123
if (!(Env.isSourceChain() && Env._strEq(Env.envVersion(), "1.9.0"))) {
@@ -79,7 +81,7 @@ contract ExecuteRewardsCoordinatorUpgrade is QueueRewardsCoordinatorUpgrade {
7981

8082
/// @dev Validate that the RewardsCoordinator proxy now points to the new implementation
8183
function _validateUpgradeComplete() internal view {
82-
address currentImpl = Env._getProxyImpl(address(Env.proxy.rewardsCoordinator()));
84+
address currentImpl = TestUtils._getProxyImpl(address(Env.proxy.rewardsCoordinator()));
8385
address expectedImpl = address(Env.impl.rewardsCoordinator());
8486

8587
assertTrue(currentImpl == expectedImpl, "RewardsCoordinator proxy should point to new implementation");
@@ -89,12 +91,7 @@ contract ExecuteRewardsCoordinatorUpgrade is QueueRewardsCoordinatorUpgrade {
8991
function _validateProxyConstructor() internal view {
9092
RewardsCoordinator rewardsCoordinator = Env.proxy.rewardsCoordinator();
9193

92-
// Validate version
93-
assertEq(
94-
keccak256(bytes(rewardsCoordinator.version())),
95-
keccak256(bytes(Env.deployVersion())),
96-
"RewardsCoordinator version mismatch"
97-
);
94+
// Note: version() function has been removed in this upgrade
9895

9996
// Validate core dependencies
10097
assertTrue(

0 commit comments

Comments
 (0)