Skip to content

Commit

Permalink
6/7/24 deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 4, 2024
1 parent a9925d7 commit b75810b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
32 changes: 23 additions & 9 deletions script/DeployOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.7.6;
import '@script/Registry.s.sol';
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';
Expand All @@ -14,14 +15,17 @@ import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol';
// 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 --account defaultKey
// 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, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
MAINNET_CHAINLINK_ETH_USD_FEED,
MAINNET_CHAINLINK_SEQUENCER_FEED,
1 days,
MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD
);

vm.stopBroadcast();
Expand All @@ -32,7 +36,7 @@ contract DeployEthUsdRelayer is Script, CommonMainnet {
// 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 --account defaultKey
// 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;
Expand All @@ -43,18 +47,28 @@ contract DeployLinkGrtEthOracles is Script, CommonMainnet {
vm.startBroadcast();

_linkUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_CHAINLINK_SEQUENCER_FEED, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
MAINNET_CHAINLINK_LINK_USD_FEED,
MAINNET_CHAINLINK_SEQUENCER_FEED,
1 hours,
MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD
);
_grtUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_CHAINLINK_SEQUENCER_FEED, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
MAINNET_CHAINLINK_GRT_USD_FEED,
MAINNET_CHAINLINK_SEQUENCER_FEED,
1 days,
MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD
);

delayedOracleFactory.deployDelayedOracle(_linkUSDRelayer, MAINNET_ORACLE_INTERVAL);
delayedOracleFactory.deployDelayedOracle(_grtUSDRelayer, MAINNET_ORACLE_INTERVAL);
delayedOracleFactory.deployDelayedOracle(
IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), MAINNET_ORACLE_INTERVAL
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();
}
}
4 changes: 2 additions & 2 deletions script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ address constant MAINNET_CHAINLINK_SEQUENCER_FEED = 0xFdB631F5EE196F0ed6FAa76795

////////// PARAMS //////////
address constant MAINNET_DEPLOYER = 0xF78dA2A37049627636546E0cFAaB2aD664950917;
uint256 constant MAINNET_ORACLE_INTERVAL = 1 hours;
uint256 constant MAINNET_GRACE_PERIOD = 1 hours;
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_WETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
address constant ETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
Expand Down

0 comments on commit b75810b

Please sign in to comment.