mirror of
https://github.com/vacp2p/staking-reward-streamer.git
synced 2026-01-07 22:43:53 -05:00
This was a bandaid solution to easily allow for upgrade scripts. We've changed those now to expect environment variables instead. This allows us to change the dependencies without committing them to version control.
29 lines
951 B
Solidity
29 lines
951 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.26;
|
|
|
|
import { BaseScript } from "./Base.s.sol";
|
|
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
|
|
|
|
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
|
|
|
import { Karma } from "../src/Karma.sol";
|
|
|
|
contract DeployKarmaScript is BaseScript {
|
|
function run() public returns (Karma, DeploymentConfig) {
|
|
DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster);
|
|
(address deployer,) = deploymentConfig.activeNetworkConfig();
|
|
|
|
vm.startBroadcast(deployer);
|
|
|
|
// Deploy Karma logic contract
|
|
bytes memory initializeData = abi.encodeCall(Karma.initialize, (deployer));
|
|
address impl = address(new Karma());
|
|
// Create upgradeable proxy
|
|
address proxy = address(new ERC1967Proxy(impl, initializeData));
|
|
|
|
vm.stopBroadcast();
|
|
|
|
return (Karma(proxy), deploymentConfig);
|
|
}
|
|
}
|