Skip to content

Commit

Permalink
Add DeployCamelotOdUsdOracle
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 25, 2024
1 parent 0008f58 commit 44d3577
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
30 changes: 27 additions & 3 deletions script/DeployOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import {Script} from 'forge-std/Script.sol';
import {CommonMainnet} from '@script/Common.s.sol';
import 'forge-std/console2.sol';

import {CamelotRelayerFactory} from '@contracts/factories/CamelotRelayerFactory.sol';
import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol';
import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol';
import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol';

// BROADCAST
Expand Down Expand Up @@ -116,3 +113,30 @@ contract DeployWstethRethL2ValidityOracles is Script, CommonMainnet {
vm.stopBroadcast();
}
}

// BROADCAST
// source .env && forge script DeployCamelotOdUsdOracle --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --broadcast --verify --etherscan-api-key $ARB_ETHERSCAN_API_KEY --sender $DEFAULT_KEY_PUBLIC_ADDRESS --account defaultKey

// SIMULATE
// source .env && forge script DeployCamelotOdUsdOracle --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --sender $DEFAULT_KEY_PUBLIC_ADDRESS

contract DeployCamelotOdUsdOracle is Script, CommonMainnet {
IBaseOracle public _odEthCamelotRelayer;
IBaseOracle public _odUsdOracle;

function run() public {
vm.startBroadcast();

_odEthCamelotRelayer = camelotRelayerFactory.deployAlgebraRelayer(
MAINNET_ALGEBRA_FACTORY, MAINNET_SYSTEM_COIN, MAINNET_WETH, uint32(ORACLE_INTERVAL_TEST)
);

_odUsdOracle = denominatedOracleFactory.deployDenominatedOracle(
_odEthCamelotRelayer, IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), false
);

_odUsdOracle.getResultWithValidity();

vm.stopBroadcast();
}
}
1 change: 1 addition & 0 deletions script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ address constant MAINNET_DEPLOYER = 0xF78dA2A37049627636546E0cFAaB2aD664950917;
uint256 constant MAINNET_ORACLE_DELAY = 1 hours;
uint256 constant MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD = 1 hours;
address constant MAINNET_PROTOCOL_TOKEN = 0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c;
address constant MAINNET_SYSTEM_COIN = 0x221A0f68770658C15B525d0F89F5da2baAB5f321;
address constant MAINNET_WETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
address constant ETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
address constant ARB = 0x912CE59144191C1204E64559FE8253a0e49E6548;
Expand Down

0 comments on commit 44d3577

Please sign in to comment.