-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add timelock function and upgrade xPufETH
- Loading branch information
1 parent
de6833d
commit c6e9c19
Showing
2 changed files
with
51 additions
and
0 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,42 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.0 <0.9.0; | ||
|
||
import "forge-std/Script.sol"; | ||
import { AccessManager } from "@openzeppelin/contracts/access/manager/AccessManager.sol"; | ||
import { stdJson } from "forge-std/StdJson.sol"; | ||
import { Multicall } from "@openzeppelin/contracts/utils/Multicall.sol"; | ||
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import { xPufETH } from "src/l2/xPufETH.sol"; | ||
import { UUPSUpgradeable } from "@openzeppelin-contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import { BaseScript } from "./BaseScript.s.sol"; | ||
|
||
/** | ||
* // Check that the simulation | ||
* add --slow if deploying to a mainnet fork like tenderly (its buggy sometimes) | ||
* | ||
* forge script script/UpgradeXpufETH.s.sol:UpgradeXpufETH --rpc-url $RPC_URL --account puffer | ||
* | ||
* forge cache clean | ||
* | ||
* forge script script/UpgradeXpufETH.s.sol:UpgradeXpufETH --rpc-url $RPC_URL --account puffer --broadcast | ||
*/ | ||
contract UpgradeXpufETH is BaseScript { | ||
address ACCCESS_MANAGER = 0x8c1686069474410E6243425f4a10177a94EBEE11; | ||
address PUFFER_VAULT = 0xD9A442856C234a39a81a089C06451EBAa4306a72; | ||
|
||
address public xPufETHProxy = 0xD7D2802f6b19843ac4DfE25022771FD83b5A7464; | ||
|
||
function run() public broadcast { | ||
xPufETH xpufETHImplementation = new xPufETH(); | ||
|
||
bytes memory upgradeCalldata = | ||
abi.encodeWithSelector(UUPSUpgradeable.upgradeToAndCall.selector, address(xpufETHImplementation), ""); | ||
|
||
bytes memory timelockCalladata = | ||
abi.encodeWithSelector(AccessManager.execute.selector, xPufETHProxy, upgradeCalldata); | ||
|
||
console.logBytes(timelockCalladata); | ||
|
||
console.log("xpufETH implementation:", address(xpufETHImplementation)); | ||
} | ||
} |
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