Skip to content

Commit

Permalink
Deploy OD / USD Oracle (#83)
Browse files Browse the repository at this point in the history
* Add DeployCamelotOdUsdOracle

* Fix quote period and redeploy OD and ODG oracles
  • Loading branch information
pi0neerpat authored Jul 26, 2024
1 parent 82f6db0 commit d6d772a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
57 changes: 54 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,57 @@ 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(MAINNET_CAMELOT_QUOTE_PERIOD)
);

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

_odUsdOracle.getResultWithValidity();

vm.stopBroadcast();
}
}

// BROADCAST
// source .env && forge script DeployCamelotOdgUsdOracle --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 DeployCamelotOdgUsdOracle --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_MAINNET_RPC --sender $DEFAULT_KEY_PUBLIC_ADDRESS

contract DeployCamelotOdgUsdOracle is Script, CommonMainnet {
IBaseOracle public _odgEthCamelotRelayer;
IBaseOracle public _odgUsdOracle;

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

_odgEthCamelotRelayer = camelotRelayerFactory.deployAlgebraRelayer(
MAINNET_ALGEBRA_FACTORY, MAINNET_PROTOCOL_TOKEN, MAINNET_WETH, uint32(MAINNET_CAMELOT_QUOTE_PERIOD)
);

_odgUsdOracle = denominatedOracleFactory.deployDenominatedOracle(
_odgEthCamelotRelayer, IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), false
);

_odgUsdOracle.getResultWithValidity();

vm.stopBroadcast();
}
}
8 changes: 6 additions & 2 deletions script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ address constant SEPOLIA_ALGEBRA_FARM_CENTER = 0x04e4A5A4E4D2A5a0fb48ECde0bbD555
address constant MAINNET_DEPLOYER = 0xF78dA2A37049627636546E0cFAaB2aD664950917;
uint256 constant MAINNET_ORACLE_DELAY = 1 hours;
uint256 constant MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD = 1 hours;
uint256 constant MAINNET_CAMELOT_QUOTE_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 All @@ -79,7 +81,8 @@ address constant MAINNET_DELAYED_ORACLE_FACTORY = 0x9Dd63fA54dEfd8820BCAb3e3cC39

////////// RELAYERS //////////
// Camelot
address constant MAINNET_CAMELOT_ODG_WETH_RELAYER = 0xF7Ec9ad3192d4ec1E54d52B3E492B5B66AB02889;
address constant MAINNET_CAMELOT_ODG_WETH_RELAYER = 0x10ef7FEcf888Bc4B1F64757B77317946fFBc5873;
address constant MAINNET_CAMELOT_OD_WETH_RELAYER = 0x43261bFF12F8D26Ae3E3ef6924Eca6FA5c32f4b6;
// Chainlink
address constant MAINNET_CHAINLINK_ETH_USD_RELAYER = 0x3e6C1621f674da311E57646007fBfAd857084383;
address constant MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER = 0x4617Feb8B72167c3b8253a1327CddE44e54670Ce;
Expand All @@ -89,7 +92,8 @@ address constant MAINNET_CHAINLINK_L2VALIDITY_RETH_ETH_RELAYER = 0x77A15A5b9b7e1
address constant MAINNET_CHAINLINK_L2VALIDITY_WSTETH_ETH_RELAYER = 0x4dF7048DC8696832A146ac4Ba8f7a791f258916c;
address constant MAINNET_CHAINLINK_ARB_USD_RELAYER = 0x2635f731BB6981E72F92A781578952450759F762;
// Denominated
address constant MAINNET_DENOMINATED_ODG_USD_ORACLE = 0xE90E52eb676bc00DD85FAE83D2FAC22062F7f470;
address constant MAINNET_DENOMINATED_ODG_USD_ORACLE = 0x734B085f68Ee612A7e51927e7B070CddE948C510;
address constant MAINNET_DENOMINATED_OD_USD_ORACLE = 0x53BA82f08639F5D0ac7b61471A6CAc0B2FAb7372;
address constant MAINNET_DENOMINATED_RETH_USD_ORACLE = 0xE0ac4511A617cBee55ECb62667B08DB6864B9d8e;
address constant MAINNET_DENOMINATED_WSTETH_USD_ORACLE = 0x8746664d1E0F0e61275EF3B52A8a3b3dFC11CcAb;
address constant MAINNET_DENOMINATED_L2VALIDITY_RETH_USD_ORACLE = 0x35843B3B7838eA15D0cAf2E61AD52C72b95b3Ca7;
Expand Down

0 comments on commit d6d772a

Please sign in to comment.