mirror of
https://github.com/vacp2p/staking-reward-streamer.git
synced 2026-01-09 15:27:55 -05:00
feat(scripts): add upgrade script
This introduces a simple upgrade script template that can be used to upgrade the stake manager.
This commit is contained in:
22
script/UpgradeRewardsStreamerMP.s.sol
Normal file
22
script/UpgradeRewardsStreamerMP.s.sol
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user