diff --git a/script/dexrelayer/DeployDataLog.s.sol b/script/dexrelayer/DeployDataLog.s.sol deleted file mode 100644 index ef56040..0000000 --- a/script/dexrelayer/DeployDataLog.s.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; -pragma abicoder v2; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {Test} from 'forge-std/Test.sol'; -import {Data} from '@contracts/for-test/Data.sol'; - -// BROADCAST -// source .env && forge script DeployDataLog --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script DeployDataLog --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract DeployDataLog is Script, Test { - function run() public { - vm.startBroadcast(vm.envUint('ARB_SEPOLIA_PK')); - Data data = new Data(); - emit log_named_address('Data:', address(data)); - } -} diff --git a/script/dexrelayer/DeployOracleFactories.s.sol b/script/dexrelayer/DeployOracleFactories.s.sol deleted file mode 100644 index 2438abf..0000000 --- a/script/dexrelayer/DeployOracleFactories.s.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol'; -import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol'; -import {IAuthorizable} from '@interfaces/utils/IAuthorizable.sol'; -import {Data} from '@contracts/for-test/Data.sol'; - -// BROADCAST -// source .env && forge script MockDeployFactories --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script MockDeployFactories --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract MockDeployFactories is Script { - Data public data = Data(RELAYER_DATA); - - ChainlinkRelayerFactory public chainlinkRelayerFactory; - DenominatedOracleFactory public denominatedOracleFactory; - - /** - * @dev CamelotRelayerFactory must be deployed by deployer of protocol - */ - function run() public { - vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK')); - chainlinkRelayerFactory = new ChainlinkRelayerFactory(); - denominatedOracleFactory = new DenominatedOracleFactory(); - - data.modifyFactory(bytes32('chainlinkRelayerFactory'), address(chainlinkRelayerFactory)); - data.modifyFactory(bytes32('denominatedOracleFactory'), address(denominatedOracleFactory)); - vm.stopBroadcast(); - } -} diff --git a/script/dexrelayer/DeployOracles.s.sol b/script/dexrelayer/DeployOracles.s.sol deleted file mode 100644 index f658fc4..0000000 --- a/script/dexrelayer/DeployOracles.s.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {IChainlinkRelayerFactory} from '@interfaces/factories/IChainlinkRelayerFactory.sol'; -import {IDenominatedOracleFactory} from '@interfaces/factories/IDenominatedOracleFactory.sol'; -import {IChainlinkRelayer} from '@interfaces/oracles/IChainlinkRelayer.sol'; -import {IDenominatedOracle} from '@interfaces/oracles/IDenominatedOracle.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -import {MintableERC20} from '@contracts/for-test/MintableERC20.sol'; -import {Data} from '@contracts/for-test/Data.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 - -// SIMULATE -// source .env && forge script DeployOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract DeployOracles is Script { - Data public data = Data(RELAYER_DATA); - - IBaseOracle public chainlinkEthUSDPriceFeed; - IBaseOracle public denominatedOracle; - - IChainlinkRelayerFactory public chainlinkRelayerFactory; - IDenominatedOracleFactory public denominatedOracleFactory; - - function run() public { - vm.startBroadcast(vm.envUint('ARB_SEPOLIA_PK')); - - // chainlinkRelayerFactory = data.chainlinkRelayerFactory(); - // denominatedOracleFactory = data.denominatedOracleFactory(); - - // // deploy chainlink relayer - // chainlinkEthUSDPriceFeed = - // chainlinkRelayerFactory.deployChainlinkRelayer(SEPOLIA_CHAINLINK_ETH_USD_FEED, ORACLE_INTERVAL_TEST); - // data.modifyOracle(bytes32('chainlinkRelayer'), address(chainlinkEthUSDPriceFeed)); - - // // deploy denominated oracle - // denominatedOracle = - // denominatedOracleFactory.deployDenominatedOracle(chainlinkEthUSDPriceFeed, camelotRelayer, false); - // data.modifyOracle(bytes32('denominatedOracle'), address(denominatedOracle)); - - vm.stopBroadcast(); - } -} diff --git a/script/dexrelayer/GetPrice.s.sol b/script/dexrelayer/GetPrice.s.sol deleted file mode 100644 index 4e61a1c..0000000 --- a/script/dexrelayer/GetPrice.s.sol +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; -pragma abicoder v2; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {Test} from 'forge-std/Test.sol'; -import {IChainlinkRelayer} from '@interfaces/oracles/IChainlinkRelayer.sol'; -import {IDenominatedOracle} from '@interfaces/oracles/IDenominatedOracle.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -import {Data} from '@contracts/for-test/Data.sol'; - -// BROADCAST -// source .env && forge script GetPrice --skip-simulation --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script GetPrice --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract GetPrice is Script, Test { -// Data public data = Data(RELAYER_DATA); - -// // Tokens -// address public tokenA = data.tokenA(); -// address public tokenB = data.tokenB(); - -// // Pool -// IAlgebraPool public pool = data.pool(); -// uint256 public initPrice = ((INIT_WETH_AMOUNT * WAD) / INIT_OD_AMOUNT); - -// // Relayers -// IBaseOracle public chainlinkRelayer = IBaseOracle(address(data.chainlinkRelayer())); -// IBaseOracle public denominatedOracle = IBaseOracle(address(data.denominatedOracle())); - -// function run() public { -// vm.startBroadcast(vm.envUint('ARB_SEPOLIA_PK')); - -// poolPrice(); -// camelotRelayerPrice(); -// chainlinkRelayerPrice(); -// denominatedOraclePrice(); -// } - -// function chainlinkRelayerPrice() public { -// uint256 _result = chainlinkRelayer.read(); -// emit log_named_uint('Chainlink ETH/USD', _result); -// } - -// function denominatedOraclePrice() public { -// uint256 _result = denominatedOracle.read(); -// emit log_named_uint('SystOracle OD/USD', _result); -// } -} - -/** - * == Logs == - * Sq Root Price X96: 1677749592786826637668640749594345472 - * Price from L-Pool: 448430472335329 - * Price Calculated: 448430493273542 - * Camelot OD/WETH: 448402863189474 ($0.0004484) - * Chainlink ETH/USD: 2217140000000000000000 ($2217.1400000) - * SystOracle OD/USD: 994171924091910384 ($0.9941719) - */ diff --git a/script/dexrelayer/Read.s.sol b/script/dexrelayer/Read.s.sol deleted file mode 100644 index db61d8a..0000000 --- a/script/dexrelayer/Read.s.sol +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; -pragma abicoder v2; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {Test} from 'forge-std/Test.sol'; -import {IChainlinkRelayer} from '@interfaces/oracles/IChainlinkRelayer.sol'; -import {IDenominatedOracle} from '@interfaces/oracles/IDenominatedOracle.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -import {Data} from '@contracts/for-test/Data.sol'; - -// BROADCAST -// source .env && forge script Read --skip-simulation --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script Read --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract Read is Script, Test { -// Data public data = Data(RELAYER_DATA); - -// // Tokens -// address public tokenA = data.tokenA(); -// address public tokenB = data.tokenB(); - -// // Pool -// IAlgebraPool public pool = data.pool(); -// uint256 public initPrice = ((INIT_WETH_AMOUNT * WAD) / INIT_OD_AMOUNT); - -// // Relayers -// IBaseOracle public chainlinkRelayer = IBaseOracle(address(data.chainlinkRelayer())); -// IBaseOracle public camelotRelayer = IBaseOracle(address(data.camelotRelayer())); -// IBaseOracle public denominatedOracle = IBaseOracle(address(data.denominatedOracle())); - -// function run() public { -// vm.startBroadcast(vm.envUint('ARB_SEPOLIA_PK')); -// readPrice(); -// readPriceInverse(); -// } - -// function readPrice() public { -// int24 _arithmeticMeanTick = DataStorageLibrary.consult(address(data.pool()), uint32(ORACLE_INTERVAL_TEST)); -// uint256 _quoteAmount = DataStorageLibrary.getQuoteAtTick({ -// tick: _arithmeticMeanTick, -// baseAmount: 1e18, -// baseToken: data.tokenA(), -// quoteToken: data.tokenB() -// }); -// emit log_named_uint('Quote Base A:', _quoteAmount); -// } - -// function readPriceInverse() public { -// int24 _arithmeticMeanTick = DataStorageLibrary.consult(address(data.pool()), uint32(ORACLE_INTERVAL_TEST)); -// uint256 _quoteAmount = DataStorageLibrary.getQuoteAtTick({ -// tick: _arithmeticMeanTick, -// baseAmount: 1e18, -// baseToken: data.tokenB(), -// quoteToken: data.tokenA() -// }); -// emit log_named_uint('Quote Base B:', _quoteAmount); -// } -} - -/** - * == Logs == - * Quote Base A:: 2230 - * Quote Base B:: 448402863189474895173495757900703 - */ diff --git a/script/dexrelayer/DeployPendleFactory.s.sol b/script/factories/DeployPendleFactory.s.sol similarity index 100% rename from script/dexrelayer/DeployPendleFactory.s.sol rename to script/factories/DeployPendleFactory.s.sol diff --git a/script/DeployOracleRegistry.s.sol b/script/oracles/DeployOracleRegistry.s.sol similarity index 100% rename from script/DeployOracleRegistry.s.sol rename to script/oracles/DeployOracleRegistry.s.sol diff --git a/script/DeployOracle.s.sol b/script/oracles/DeployPendleOracle.s.sol similarity index 53% rename from script/DeployOracle.s.sol rename to script/oracles/DeployPendleOracle.s.sol index 554d901..304a9c2 100644 --- a/script/DeployOracle.s.sol +++ b/script/oracles/DeployPendleOracle.s.sol @@ -9,68 +9,6 @@ import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFact import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol'; import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -// BROADCAST -// source .env && forge script DeployEthUsdRelayer --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --account defaultKey --sender $DEFAULT_KEY_PUBLIC_ADDRESS - -// SIMULATE -// source .env && forge script DeployEthUsdRelayer --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --sender $DEFAULT_KEY_PUBLIC_ADDRESS - -contract DeployEthUsdRelayer is Script, CommonMainnet { - function run() public { - vm.startBroadcast(); - - chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity( - MAINNET_CHAINLINK_ETH_USD_FEED, - MAINNET_CHAINLINK_SEQUENCER_FEED, - 1 days, - MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD - ); - - vm.stopBroadcast(); - } -} - -// BROADCAST -// source .env && forge script DeployLinkGrtEthOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --account defaultKey --sender $DEFAULT_KEY_PUBLIC_ADDRESS - -// SIMULATE -// source .env && forge script DeployLinkGrtEthOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --sender $DEFAULT_KEY_PUBLIC_ADDRESS - -contract DeployLinkGrtEthOracles is Script, CommonMainnet { - IBaseOracle public _linkUSDRelayer; - IBaseOracle public _grtUSDRelayer; - IBaseOracle public _ethDelayedOracle; - - function run() public { - vm.startBroadcast(); - - _linkUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity( - MAINNET_CHAINLINK_LINK_USD_FEED, - MAINNET_CHAINLINK_SEQUENCER_FEED, - 1 hours, - MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD - ); - _grtUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity( - MAINNET_CHAINLINK_GRT_USD_FEED, - MAINNET_CHAINLINK_SEQUENCER_FEED, - 1 days, - MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD - ); - - IBaseOracle linkOracle = delayedOracleFactory.deployDelayedOracle(_linkUSDRelayer, MAINNET_ORACLE_DELAY); - IBaseOracle grtOracle = delayedOracleFactory.deployDelayedOracle(_grtUSDRelayer, MAINNET_ORACLE_DELAY); - IBaseOracle ethOracle = delayedOracleFactory.deployDelayedOracle( - IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), MAINNET_ORACLE_DELAY - ); - - linkOracle.getResultWithValidity(); - grtOracle.getResultWithValidity(); - ethOracle.getResultWithValidity(); - - vm.stopBroadcast(); - } -} - // BROADCAST // source .env && forge script DeployRethPtToSyPendleRelayerMainnet rtEthOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --account defaultKey --sender $DEFAULT_KEY_PUBLIC_ADDRESS // SIMULATE diff --git a/script/postdeployment/MockSetupPostEnvironment.s.sol b/script/postdeployment/MockSetupPostEnvironment.s.sol deleted file mode 100644 index d74f546..0000000 --- a/script/postdeployment/MockSetupPostEnvironment.s.sol +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import 'forge-std/console2.sol'; -import '@script/Registry.s.sol'; -import {CommonSepolia} from '@script/Common.s.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -import {MintableERC20} from '@contracts/for-test/MintableERC20.sol'; -import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; - -interface IVault721 { - function getProxy(address _user) external view returns (address); - function build(address _user) external returns (address payable); -} - -interface ODProxy { - function execute(address _target, bytes memory _data) external returns (bytes memory); -} - -// 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 CommonSepolia { -// MintableERC20 public mockWeth; -// MintableERC20 public mockWsteth = MintableERC20(0x5Ae92E2cBce39b74f149B7dA16d863382397d4a7); -// address public systemCoinOracle; - -// function run() public { -// vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK')); - -// // deploy mock WETH token -// mockWeth = new MintableERC20('Wrapped ETH', 'WETH', 18); - -// // deploy chainlinkRelayer -// IBaseOracle chainlinkEthUSDPriceFeed = -// chainlinkRelayerFactory.deployChainlinkRelayer(SEPOLIA_CHAINLINK_ETH_USD_FEED, ORACLE_INTERVAL_TEST); - -// // system coin oracle was deployed here - -// // add authorizations -// authOnlyFactories(); - -// // check pool balance before -// IERC20(SEPOLIA_SYSTEM_COIN).balanceOf(_pool); -// IERC20(mockWeth).balanceOf(_pool); - -// // mint SystemCoin and Weth to use as liquidity -// mintMockWeth(); -// mintSystemCoin(); - -// // deploy Router for AlgebraPool -// // Router _router = new Router(IAlgebraPool(_pool), deployer); - -// // approve tokens to Router -// // IERC20(SEPOLIA_SYSTEM_COIN).approve(address(_router), MINT_AMOUNT); -// // IERC20(mockWeth).approve(address(_router), MINT_AMOUNT); - -// // add liquidity -// (int24 bottomTick, int24 topTick) = generateTickParams(IAlgebraPool(_pool)); -// _router.addLiquidity(bottomTick, topTick, uint128(1 ether)); - -// // check pool balance after -// IERC20(SEPOLIA_SYSTEM_COIN).balanceOf(_pool); -// IERC20(mockWeth).balanceOf(_pool); - -// // log OD / USD denominated oracle address -// console2.logBytes20(bytes20(systemCoinOracle)); - -// vm.stopBroadcast(); -// } - -// function mintMockWeth() public { -// mockWeth.mint(deployer, MINT_AMOUNT); -// } - -// // todo: remove `magic` numbers - refactor -// function mintSystemCoin() public { -// IVault721 vault721 = IVault721(0xa602c0cFf8028Dd4c99fbC5e85cF0c083C5b991A); -// address _safeManager = 0x8ca7D88eaFB6f666997Ca0F62Beddd8A09a62910; -// address _basicActions = 0x60487E0a0eFbfbD30908b03ea6b7833E2520604F; -// address _coinJoin = 0x93544B224AB94F2b568CaeD5A074f4217fC782c7; -// address _collateralJoin_wsteth = 0x52400D3AEB82b0923898D918be51439A9198D980; - -// // create proxy for deployer -// address _proxy = vault721.getProxy(deployer); -// if (_proxy == address(0)) { -// _proxy = vault721.build(deployer); -// } - -// // create safe for deployer -// bytes memory _payload = -// abi.encodeWithSignature('openSAFE(address,bytes32,address)', _safeManager, bytes32('WSTETH'), _proxy); -// bytes memory _safeData = ODProxy(_proxy).execute(_basicActions, _payload); -// uint256 _safeId = abi.decode(_safeData, (uint256)); - -// // mint token -// mockWsteth.mint(deployer, MINT_AMOUNT); -// IERC20(mockWsteth).approve(_proxy, MINT_AMOUNT); - -// // lock collateral & generate debt -// bytes memory payload = abi.encodeWithSignature( -// 'lockTokenCollateralAndGenerateDebt(address,address,address,uint256,uint256,uint256)', -// _safeManager, -// _collateralJoin_wsteth, -// _coinJoin, -// _safeId, -// 850 ether, -// 500_000 ether -// ); -// ODProxy(_proxy).execute(_basicActions, payload); -// } - -// find tick and add 10X spacing on either side of pool price -// function generateTickParams(IAlgebraPool pool) public view returns (int24 bottomTick, int24 topTick) { -// (, int24 tick,,,,,) = pool.globalState(); -// int24 tickSpacing = pool.tickSpacing(); -// console2.logInt(tick); -// console2.logInt(tickSpacing); -// bottomTick = ((tick / tickSpacing) * tickSpacing) - 10 * tickSpacing; -// topTick = ((tick / tickSpacing) * tickSpacing) + 10 * tickSpacing; -// } -} diff --git a/script/postdeployment/SetupPostEnvironment.s.sol b/script/postdeployment/SetupPostEnvironment.s.sol deleted file mode 100644 index 74f2c6a..0000000 --- a/script/postdeployment/SetupPostEnvironment.s.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import 'forge-std/console2.sol'; -import '@script/Registry.s.sol'; -import {CommonSepolia} from '@script/Common.s.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; -import {MintableERC20} from '@contracts/for-test/MintableERC20.sol'; - -// BROADCAST -// source .env && forge script SetupPostEnvironment --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script SetupPostEnvironment --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract SetupPostEnvironment is CommonSepolia { - // IAlgebraFactory public algebraFactory = IAlgebraFactory(SEPOLIA_ALGEBRA_FACTORY); - - 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)); - - // IBaseOracle _odWethOracle = camelotRelayerFactory.deployAlgebraRelayer( - // SEPOLIA_ALGEBRA_FACTORY, SEPOLIA_SYSTEM_COIN, SEPOLIA_WETH, uint32(ORACLE_INTERVAL_TEST) - // ); - - // 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));` - */ - vm.stopBroadcast(); - } -} diff --git a/script/predeployment/DeployFactories.s.sol b/script/predeployment/DeployFactories.s.sol deleted file mode 100644 index 79e4241..0000000 --- a/script/predeployment/DeployFactories.s.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import '@script/Registry.s.sol'; -import {Script} from 'forge-std/Script.sol'; -import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol'; -import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol'; - -// BROADCAST -// source .env && forge script DeployFactoriesMain --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script DeployFactoriesMain --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC - -contract DeployFactoriesMain is Script { - ChainlinkRelayerFactory internal _chainlinkRelayerFactory; - DenominatedOracleFactory internal _denominatedOracleFactory; - - function run() public { - vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK')); - _chainlinkRelayerFactory = new ChainlinkRelayerFactory(); - _denominatedOracleFactory = new DenominatedOracleFactory(); - - _chainlinkRelayerFactory.addAuthorization(MAINNET_DEPLOYER); - _denominatedOracleFactory.addAuthorization(MAINNET_DEPLOYER); - vm.stopBroadcast(); - } -} - -// BROADCAST -// source .env && forge script DeployFactoriesSepolia --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script DeployFactoriesSepolia --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC - -contract DeployFactoriesSepolia is Script { - ChainlinkRelayerFactory internal _chainlinkRelayerFactory; - DenominatedOracleFactory internal _denominatedOracleFactory; - - function run() public { - vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK')); - _chainlinkRelayerFactory = new ChainlinkRelayerFactory(); - _denominatedOracleFactory = new DenominatedOracleFactory(); - vm.stopBroadcast(); - } -} diff --git a/script/predeployment/DeployRelayers.s.sol b/script/predeployment/DeployRelayers.s.sol deleted file mode 100644 index f44c6a3..0000000 --- a/script/predeployment/DeployRelayers.s.sol +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.26; - -import '@script/Registry.s.sol'; -import {CommonMainnet} from '@script/Common.s.sol'; -import {IDelayedOracleFactory} from '@interfaces/factories/IDelayedOracleFactory.sol'; -import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol'; - -// BROADCAST -// source .env && forge script DeployEthUsdChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script DeployEthUsdChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC - -contract DeployEthUsdChainlinkRelayerMainnet is CommonMainnet { - function run() public { - vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK')); - chainlinkRelayerFactory.deployChainlinkRelayer(MAINNET_CHAINLINK_ETH_USD_FEED, MAINNET_ORACLE_DELAY); - vm.stopBroadcast(); - } -} - -// BROADCAST -// source .env && forge script DeployRethEthChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY - -// SIMULATE -// source .env && forge script DeployRethEthChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC - -contract DeployRethEthChainlinkRelayerMainnet is CommonMainnet { - function run() public { - vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK')); - IBaseOracle _chainlinkRethEthPriceFeed = - chainlinkRelayerFactory.deployChainlinkRelayer(MAINNET_CHAINLINK_RETH_ETH_FEED, MAINNET_ORACLE_DELAY); - - IBaseOracle _rethUsdOracle = denominatedOracleFactory.deployDenominatedOracle( - _chainlinkRethEthPriceFeed, IBaseOracle(MAINNET_CHAINLINK_ETH_USD_RELAYER), false - ); - - _rethUsdOracle.symbol(); // "(RETH / ETH) * (ETH / USD)" - vm.stopBroadcast(); - } -} - -// BROADCAST -// source .env && forge script DeployWstethEthChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --account defaultKey --sender $DEFAULT_KEY_PUBLIC_ADDRESS - -// SIMULATE -// source .env && forge script DeployWstethEthChainlinkRelayerMainnet --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC - -contract DeployWstethEthChainlinkRelayerMainnet is CommonMainnet { - function run() public { - vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK')); - IBaseOracle _chainlinkWstethEthPriceFeed = - chainlinkRelayerFactory.deployChainlinkRelayer(MAINNET_CHAINLINK_WSTETH_ETH_FEED, MAINNET_ORACLE_DELAY); - - IBaseOracle _wstethUsdOracle = denominatedOracleFactory.deployDenominatedOracle( - _chainlinkWstethEthPriceFeed, IBaseOracle(MAINNET_CHAINLINK_ETH_USD_RELAYER), false - ); - - _wstethUsdOracle.symbol(); // "(WSTETH / ETH) * (ETH / USD)" - vm.stopBroadcast(); - } -} - -// BROADCAST -// source .env && forge script DeployEzEthUSDPriceFeed rtEthOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --account defaultKey --sender $DEFAULT_KEY_PUBLIC_ADDRESS -// SIMULATE -// source .env && forge script DeployEzEthUSDPriceFeed rtEthOracles --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --sender $DEFAULT_KEY_PUBLIC -contract DeployEzEthUSDPriceFeed is CommonMainnet { - function run() public { - vm.startBroadcast(); - IBaseOracle _ezEthEthPriceFeed = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity( - MAINNET_CHAINLINK_EZETH_ETH_FEED, - MAINNET_CHAINLINK_SEQUENCER_FEED, - MAINNET_ORACLE_DELAY, - MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD - ); - - IBaseOracle _ezEthUsdOracle = denominatedOracleFactory.deployDenominatedOracle( - _ezEthEthPriceFeed, IBaseOracle(MAINNET_CHAINLINK_ETH_USD_RELAYER), false - ); - - IBaseOracle _ezEthUsdDelayedOracle = delayedOracleFactory.deployDelayedOracle(_ezEthUsdOracle, MAINNET_ORACLE_DELAY); - - _ezEthUsdDelayedOracle.symbol(); // "(EZETH / ETH) * (ETH / USD)" - vm.stopBroadcast(); - } -}