Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
daopunk committed Jan 2, 2024
1 parent 31de74d commit 1a35a7c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
4 changes: 0 additions & 4 deletions script/dexrelayer/DeployOracles.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
49 changes: 1 addition & 48 deletions script/postdeployment/SetupPostEnvironment.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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));`
Expand All @@ -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);

Expand Down

0 comments on commit 1a35a7c

Please sign in to comment.