Files
staking-reward-streamer/script/UpgradeRewardsStreamerMP.s.sol
r4bbit b5ce251b8e feat(scripts): add upgrade script
This introduces a simple upgrade script template that can be used to
upgrade the stake manager.
2024-12-10 13:26:33 +01:00

23 lines
929 B
Solidity

// 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();
}
}