-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol): upgrade scripts for new proxies (#15452)
Co-authored-by: David <[email protected]>
- Loading branch information
1 parent
391eff3
commit 37e6b62
Showing
13 changed files
with
388 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/protocol/script/upgrade/UpgradeAddressManager.sol
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/common/AddressManager.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeAddressManager is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading AddressManager"); | ||
AddressManager newAddressManager = new AddressManager(); | ||
upgrade(address(newAddressManager)); | ||
|
||
console2.log("upgraded AddressManager to", address(newAddressManager)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/L1/hooks/AssignmentHook.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeAssignmentHook is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading AssignmentHook"); | ||
AssignmentHook newAssignmentHook = new AssignmentHook(); | ||
upgrade(address(newAssignmentHook)); | ||
|
||
console2.log("upgraded AssignmentHook to", address(newAssignmentHook)); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/bridge/Bridge.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeBridge is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading bridge"); | ||
Bridge newBridge = new Bridge(); | ||
upgrade(address(newBridge)); | ||
|
||
console2.log("upgraded bridge to", address(newBridge)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/tokenvault/ERC1155Vault.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeERC1155Vault is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading ERC1155Vault"); | ||
ERC1155Vault newERC1155Vault = new ERC1155Vault(); | ||
upgrade(address(newERC1155Vault)); | ||
|
||
console2.log("upgraded ERC1155Vault to", address(newERC1155Vault)); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/tokenvault/ERC20Vault.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeERC20Vault is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading ERC20Vault"); | ||
ERC20Vault newERC20Vault = new ERC20Vault(); | ||
upgrade(address(newERC20Vault)); | ||
|
||
console2.log("upgraded ERC20Vault to", address(newERC20Vault)); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/tokenvault/ERC721Vault.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeERC721Vault is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading ERC721Vault"); | ||
ERC721Vault newERC721Vault = new ERC721Vault(); | ||
upgrade(address(newERC721Vault)); | ||
|
||
console2.log("upgraded ERC721Vault to", address(newERC721Vault)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/L1/provers/GuardianProver.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeGuardianProver is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading GuardianProver"); | ||
GuardianProver newGuardianProver = new GuardianProver(); | ||
upgrade(address(newGuardianProver)); | ||
|
||
console2.log("upgraded GuardianProver to", address(newGuardianProver)); | ||
} | ||
} |
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,56 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity 0.8.20; | ||
|
||
import "../../contracts/L1/gov/TaikoTimelockController.sol"; | ||
import "lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol"; | ||
|
||
import "forge-std/console2.sol"; | ||
import "forge-std/Script.sol"; | ||
|
||
contract UpgradeScript is Script { | ||
uint256 public privateKey = vm.envUint("PRIVATE_KEY"); | ||
address public timelockAddress = vm.envAddress("TIMELOCK_ADDRESS"); | ||
address public proxyAddress = vm.envAddress("PROXY_ADDRESS"); | ||
|
||
UUPSUpgradeable proxy; | ||
TaikoTimelockController timelock; | ||
|
||
modifier setUp() { | ||
require(privateKey != 0, "PRIVATE_KEY not set"); | ||
require(proxyAddress != address(0), "PROXY_ADDRESS not set"); | ||
require(timelockAddress != address(0), "TIMELOCK_ADDRESS not set"); | ||
|
||
proxy = UUPSUpgradeable(payable(proxyAddress)); | ||
timelock = TaikoTimelockController(payable(timelockAddress)); | ||
|
||
vm.startBroadcast(privateKey); | ||
|
||
_; | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function upgrade(address newImpl) public { | ||
bytes32 salt = bytes32(block.timestamp); | ||
|
||
bytes memory payload = | ||
abi.encodeWithSelector(bytes4(keccak256("upgradeTo(address)")), newImpl); | ||
|
||
timelock.schedule(address(proxy), 0, payload, bytes32(0), salt, 0); | ||
|
||
timelock.execute(address(proxy), 0, payload, bytes32(0), salt); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/signal/SignalService.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeSignalService is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading SignalService"); | ||
SignalService newSignalService = new SignalService(); | ||
upgrade(address(newSignalService)); | ||
|
||
console2.log("upgraded SignalService to", address(newSignalService)); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/L1/gov/TaikoGovernor.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeTaikoGovernor is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading TaikoGovernor"); | ||
TaikoGovernor newTaikoGovernor = new TaikoGovernor(); | ||
upgrade(address(newTaikoGovernor)); | ||
|
||
console2.log("upgraded TaikoGovernor to", address(newTaikoGovernor)); | ||
} | ||
} |
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/L1/TaikoL1.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeTaikoL1 is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading TaikoL1"); | ||
TaikoL1 newTaikoL1 = new TaikoL1(); | ||
upgrade(address(newTaikoL1)); | ||
|
||
console2.log("upgraded TaikoL1 to", address(newTaikoL1)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/protocol/script/upgrade/UpgradeTimelockController.s.sol
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,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
// _____ _ _ _ _ | ||
// |_ _|_ _(_) |_____ | | __ _| |__ ___ | ||
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< | ||
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ | ||
// | ||
// Email: [email protected] | ||
// Website: https://taiko.xyz | ||
// GitHub: https://github.com/taikoxyz | ||
// Discord: https://discord.gg/taikoxyz | ||
// Twitter: https://twitter.com/taikoxyz | ||
// Blog: https://mirror.xyz/labs.taiko.eth | ||
// Youtube: https://www.youtube.com/@taikoxyz | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import "forge-std/Script.sol"; | ||
import "forge-std/console2.sol"; | ||
import "../../contracts/L1/gov/TaikoTimelockController.sol"; | ||
import "./UpgradeScript.s.sol"; | ||
|
||
contract UpgradeTaikoTimelockController is UpgradeScript { | ||
function run() external setUp { | ||
console2.log("upgrading TaikoTimelockController"); | ||
TaikoTimelockController newTaikoTimelockController = new TaikoTimelockController(); | ||
upgrade(address(newTaikoTimelockController)); | ||
|
||
console2.log("upgraded TaikoTimelockController to", address(newTaikoTimelockController)); | ||
} | ||
} |
Oops, something went wrong.
37e6b62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bridge-ui-v2-a6 – ./packages/bridge-ui-v2
bridge-ui-v2-a6.vercel.app
bridge-ui-v2-a6-git-alpha-6-taikoxyz.vercel.app
bridge-ui-v2-a6-taikoxyz.vercel.app
bridge.katla.taiko.xyz
37e6b62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bridge-ui-v2-internal – ./packages/bridge-ui-v2
bridge-ui-v2-internal-taikoxyz.vercel.app
bridge-ui-v2-internal.vercel.app
bridge-ui-v2-internal-git-alpha-6-taikoxyz.vercel.app