-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces a simple upgrade script template that can be used to upgrade the stake manager.
- Loading branch information
Showing
4 changed files
with
77 additions
and
36 deletions.
There are no files selected for viewing
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
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
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,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import { BaseScript } from "./Base.s.sol"; | ||
import { RewardsStreamerMP } from "../src/RewardsStreamerMP.sol"; | ||
import { IStakeManagerProxy } from "../src/interfaces/IStakeManagerProxy.sol"; | ||
|
||
contract UpgradeRewardsStreamerMPScript is BaseScript { | ||
function run(address admin, IStakeManagerProxy currentImplProxy) public { | ||
address deployer = broadcaster; | ||
if (admin != address(0)) { | ||
deployer = admin; | ||
} | ||
vm.startBroadcast(deployer); | ||
// Replace this with actual new version of the contract | ||
address nextImpl = address(new RewardsStreamerMP()); | ||
bytes memory initializeData; | ||
UUPSUpgradeable(address(currentImplProxy)).upgradeToAndCall(nextImpl, initializeData); | ||
vm.stopBroadcast(); | ||
} | ||
} |
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