-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity 0.8.19; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
import {RewardEscrowV2} from "../contracts/RewardEscrowV2.sol"; | ||
import {StakingRewardsV2} from "../contracts/StakingRewardsV2.sol"; | ||
import {OptimismParameters} from "scripts/utils/parameters/OptimismParameters.sol"; | ||
|
||
/// @dev steps to upgrade RewardEscrowV2 on Optimism: | ||
/// (1) ensure the .env file contains the following variables: | ||
/// - DEPLOYER_PRIVATE_KEY - the private key of the deployer | ||
/// - ETHERSCAN_API_KEY - the API key of the Optimism Etherscan account (a normal etherscan API key will not work) | ||
/// - ARCHIVE_NODE_URL_L2 - the archive node URL of the Optimism network | ||
/// (2) load the variables in the .env file via `source .env` | ||
/// (3) run `forge script scripts/Upgrade.s.sol:UpgradeRewardEscrowV2 --rpc-url $ARCHIVE_NODE_URL_L2 --etherscan-api-key $ETHERSCAN_API_KEY --broadcast --verify -vvvv`` | ||
/// (4) Call upgradeTo() on the proxy with the new implementation address | ||
contract UpgradeRewardEscrowV2 is Script, OptimismParameters { | ||
function run() public { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
RewardEscrowV2 rewardEscrowImplementation = new RewardEscrowV2(KWENTA_TOKEN, STAKING_REWARDS_NOTIFIER); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} | ||
|
||
|
||
/// @dev steps to upgrade StakingRewardsV2 on Optimism: | ||
/// (1) ensure the .env file contains the following variables: | ||
/// - DEPLOYER_PRIVATE_KEY - the private key of the deployer | ||
/// - ETHERSCAN_API_KEY - the API key of the Optimism Etherscan account (a normal etherscan API key will not work) | ||
/// - ARCHIVE_NODE_URL_L2 - the archive node URL of the Optimism network | ||
/// (2) load the variables in the .env file via `source .env` | ||
/// (3) run `forge script scripts/Upgrade.s.sol:UpgradeStakingRewardsV2 --rpc-url $ARCHIVE_NODE_URL_L2 --etherscan-api-key $ETHERSCAN_API_KEY --broadcast --verify -vvvv`` | ||
/// (4) Call upgradeTo() on the proxy with the new implementation address | ||
contract UpgradeStakingRewardsV2 is Script, OptimismParameters { | ||
function run() public { | ||
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
StakingRewardsV2 stakingRewardsV2Implementation = new StakingRewardsV2( | ||
KWENTA_TOKEN, | ||
USDC_TOKEN, | ||
REWARD_ESCROW_V2, | ||
STAKING_REWARDS_NOTIFIER | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity 0.8.19; | ||
|
||
contract OptimismParameters { | ||
address public constant KWENTA_TOKEN = 0x920Cf626a271321C151D027030D5d08aF699456b; | ||
|
||
address public constant STAKING_REWARDS_NOTIFIER = 0xb176DaD2916db0905cd2D65ed54FDC3a878aFFe4; | ||
|
||
address public constant REWARD_ESCROW_V2 = 0xb2a20fCdc506a685122847b21E34536359E94C56; | ||
|
||
address public constant USDC_TOKEN = 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85; | ||
} |