Skip to content

Commit

Permalink
Update script for the ETHX price feed
Browse files Browse the repository at this point in the history
  • Loading branch information
zmanian committed Jun 17, 2024
1 parent f7c90bd commit 9f1fe5a
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions script/Mainnet/production/switchETHXPriceFeed.s.sol
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();}

}

0 comments on commit 9f1fe5a

Please sign in to comment.