From 1a35a7c0751733d81ef1d088dad9df441d462241 Mon Sep 17 00:00:00 2001 From: Hunter King Date: Tue, 2 Jan 2024 15:37:08 -0500 Subject: [PATCH] fix merge conflict --- script/dexrelayer/DeployOracles.s.sol | 4 -- .../postdeployment/SetupPostEnvironment.s.sol | 49 +------------------ 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/script/dexrelayer/DeployOracles.s.sol b/script/dexrelayer/DeployOracles.s.sol index 2085bd4..d11de28 100644 --- a/script/dexrelayer/DeployOracles.s.sol +++ b/script/dexrelayer/DeployOracles.s.sol @@ -11,10 +11,6 @@ import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; import {MintableERC20} from '@contracts/for-test/MintableERC20.sol'; import {Data} from '@contracts/for-test/Data.sol'; -// TODO test denominated oracle after relayer works -// import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol'; -// import {ChainlinkRelayerFactory, IChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol'; - // BROADCAST // source .env && forge script DeployOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY diff --git a/script/postdeployment/SetupPostEnvironment.s.sol b/script/postdeployment/SetupPostEnvironment.s.sol index 8e898d9..533b055 100644 --- a/script/postdeployment/SetupPostEnvironment.s.sol +++ b/script/postdeployment/SetupPostEnvironment.s.sol @@ -22,16 +22,14 @@ contract SetupPostEnvironment is Common { function run() public { vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK')); - algebraFactory.createPool(SEPOLIA_SYSTEM_COIN, SEPOLIA_WETH); address _pool = algebraFactory.poolByPair(SEPOLIA_SYSTEM_COIN, SEPOLIA_WETH); uint160 _sqrtPriceX96 = initialPrice(INIT_OD_AMOUNT, INIT_WETH_AMOUNT, _pool); IAlgebraPool(_pool).initialize(uint160(_sqrtPriceX96)); - // Todo: change to WETH for next deployment IBaseOracle _odWethOracle = camelotRelayerFactory.deployAlgebraRelayer( - SEPOLIA_ALGEBRA_FACTORY, SEPOLIA_SYSTEM_COIN, address(mockWeth), uint32(ORACLE_INTERVAL_TEST) + SEPOLIA_ALGEBRA_FACTORY, SEPOLIA_SYSTEM_COIN, SEPOLIA_WETH, uint32(ORACLE_INTERVAL_TEST) ); IBaseOracle chainlinkEthUSDPriceFeed = @@ -42,17 +40,6 @@ contract SetupPostEnvironment is Common { revokeFactories(); - /** - * note oracleRelayer will be set to systemOracle in odContracts post deploy script - * code: `oracleRelayer.modifyParameters('systemCoinOracle', abi.encode(systemCoinOracle));` - IBaseOracle chainlinkEthUSDPriceFeed = - chainlinkRelayerFactory.deployChainlinkRelayer(SEPOLIA_CHAINLINK_ETH_USD_FEED, ORACLE_INTERVAL_TEST); - - // deploy systemOracle - denominatedOracleFactory.deployDenominatedOracle(_odWethOracle, chainlinkEthUSDPriceFeed, false); - - revokeFactories(); - /** * note oracleRelayer will be set to systemOracle in odContracts post deploy script * code: `oracleRelayer.modifyParameters('systemCoinOracle', abi.encode(systemCoinOracle));` @@ -68,40 +55,6 @@ contract SetupPostEnvironment is Common { // SIMULATE // source .env && forge script MockSetupPostEnvironment --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC -contract MockSetupPostEnvironment is Common { - IAlgebraFactory public algebraFactory = IAlgebraFactory(SEPOLIA_ALGEBRA_FACTORY); - - function run() public { - vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK')); - MintableERC20 mockWeth = new MintableERC20('Wrapped ETH', 'WETH', 18); - - algebraFactory.createPool(SEPOLIA_SYSTEM_COIN, address(mockWeth)); - address _pool = algebraFactory.poolByPair(SEPOLIA_SYSTEM_COIN, address(mockWeth)); - - uint160 _sqrtPriceX96 = initialPrice(INIT_OD_AMOUNT, INIT_WETH_AMOUNT, _pool); - IAlgebraPool(_pool).initialize(uint160(_sqrtPriceX96)); - - IBaseOracle _odWethOracle = camelotRelayerFactory.deployAlgebraRelayer( - SEPOLIA_ALGEBRA_FACTORY, SEPOLIA_SYSTEM_COIN, address(mockWeth), uint32(ORACLE_INTERVAL_TEST) - ); - - IBaseOracle chainlinkEthUSDPriceFeed = - chainlinkRelayerFactory.deployChainlinkRelayer(SEPOLIA_CHAINLINK_ETH_USD_FEED, ORACLE_INTERVAL_TEST); - - // deploy systemOracle - denominatedOracleFactory.deployDenominatedOracle(_odWethOracle, chainlinkEthUSDPriceFeed, false); - - authOnlyFactories(); - - vm.stopBroadcast(); -} - -// BROADCAST -// source .env && forge script MockSetupPostEnvironment --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script MockSetupPostEnvironment --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - contract MockSetupPostEnvironment is Common { IAlgebraFactory public algebraFactory = IAlgebraFactory(SEPOLIA_ALGEBRA_FACTORY);