-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade.s.sol: seperate update logic script
- Loading branch information
1 parent
c01311d
commit 24f5b79
Showing
2 changed files
with
54 additions
and
48 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
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,54 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {Upgrades} from "@openzeppelin/foundry-upgrades/Upgrades.sol"; | ||
import {Script} from "forge-std/Script.sol"; | ||
import {Helper} from "./Helper.s.sol"; | ||
|
||
contract UpgradeLLMOracleCoordinator is Script { | ||
Helper public helper; | ||
|
||
constructor() { | ||
helper = new Helper(); | ||
} | ||
|
||
function run() public returns (address impl) { | ||
// todo: get proxy address | ||
address proxy = 0xe3Ab5D57Feb189d7CD1685336FD638856391b9EB; | ||
|
||
vm.startBroadcast(); | ||
impl = upgrade(proxy); | ||
vm.stopBroadcast(); | ||
|
||
helper.writeProxyAddresses("LLMOracleCoordinator", proxy, impl); | ||
} | ||
|
||
function upgrade(address proxy) public returns (address impl) { | ||
Upgrades.upgradeProxy(proxy, "LLMOracleCoordinatorV2.sol", ""); | ||
impl = Upgrades.getImplementationAddress(proxy); | ||
} | ||
} | ||
|
||
contract UpgradeLLMOracleRegistry is Script { | ||
Helper public helper; | ||
|
||
constructor() { | ||
helper = new Helper(); | ||
} | ||
|
||
function run() public returns (address impl) { | ||
// todo: get proxy address | ||
address proxy = 0x568Cfb5363E70Cde784f8603E2748e614c3420a7; | ||
|
||
vm.startBroadcast(); | ||
impl = upgrade(proxy); | ||
vm.stopBroadcast(); | ||
|
||
helper.writeProxyAddresses("LLMOracleRegistry", proxy, impl); | ||
} | ||
|
||
function upgrade(address proxy) public returns (address impl) { | ||
Upgrades.upgradeProxy(proxy, "LLMOracleRegistryV2.sol", ""); | ||
impl = Upgrades.getImplementationAddress(proxy); | ||
} | ||
} |