-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update script for the ETHX price feed
- Loading branch information
Showing
1 changed file
with
47 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,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity 0.8.21; | ||
|
||
import { Math } from "src/utils/Math.sol"; | ||
import { Deployer } from "src/Deployer.sol"; | ||
import { ERC4626 } from "@solmate/mixins/ERC4626.sol"; | ||
import { ERC20 } from "@solmate/tokens/ERC20.sol"; | ||
import { Registry } from "src/Registry.sol"; | ||
import { PriceRouter } from "src/modules/price-router/PriceRouter.sol"; | ||
import { IChainlinkAggregator } from "src/interfaces/external/IChainlinkAggregator.sol"; | ||
import { ERC20Adaptor } from "src/modules/adaptors/ERC20Adaptor.sol"; | ||
|
||
import { MainnetAddresses } from "test/resources/MainnetAddresses.sol"; | ||
|
||
import "forge-std/Script.sol"; | ||
|
||
/** | ||
* @dev Run | ||
* `source .env && forge script script/Mainnet/production/Gnosis8.s.sol:Gnosis8Script --rpc-url $MAINNET_RPC_URL --sender $MULTI_SIG --with-gas-price 25000000000` | ||
*/ | ||
contract swithEthXPriceFeed is Script, MainnetAddresses { | ||
|
||
address public sommDev = 0x552acA1343A6383aF32ce1B7c7B1b47959F7ad90; | ||
|
||
Deployer public deployer = Deployer(deployerAddress); | ||
|
||
Registry public registry = Registry(0xEED68C267E9313a6ED6ee08de08c9F68dee44476); | ||
PriceRouter public priceRouter = PriceRouter(0xA1A0bc3D59e4ee5840c9530e49Bdc2d1f88AaF92); | ||
|
||
|
||
uint8 public constant CHAINLINK_DERIVATIVE = 1; | ||
uint8 public constant TWAP_DERIVATIVE = 2; | ||
uint8 public constant EXTENSION_DERIVATIVE = 3; | ||
|
||
function run() external { | ||
|
||
uint256 price = uint256(IChainlinkAggregator(WETH_USD_FEED).latestAnswer()); | ||
settings = PriceRouter.AssetSettings(CHAINLINK_DERIVATIVE, ETHX_USD_FEED); | ||
PriceRouter.ChainlinkDerivativeStorage memory stor; | ||
|
||
vm.startBroadcast(); | ||
|
||
priceRouter.startEditAsset(ETHX, settings, abi.encode(stor)); | ||
|
||
vm.stopBroadcast();} | ||
|
||
} |