Skip to content

Commit

Permalink
fix l2validity arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 4, 2024
1 parent a9c214d commit 4c1a79c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 213 deletions.
4 changes: 2 additions & 2 deletions script/Common.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {IAuthorizable} from '@interfaces/utils/IAuthorizable.sol';
import {CamelotRelayerFactory} from '@contracts/factories/CamelotRelayerFactory.sol';
import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol';
import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol';
import {DelayedOracleFactory} from '@contracts/factories/DelayedOracleFactory.sol';
import {IDelayedOracleFactory} from '@interfaces/factories/IDelayedOracleFactory.sol';

abstract contract CommonMainnet is Script {
ChainlinkRelayerFactory public chainlinkRelayerFactory = ChainlinkRelayerFactory(MAINNET_CHAINLINK_RELAYER_FACTORY);
CamelotRelayerFactory public camelotRelayerFactory = CamelotRelayerFactory(MAINNET_CAMELOT_RELAYER_FACTORY);
DenominatedOracleFactory public denominatedOracleFactory =
DenominatedOracleFactory(MAINNET_DENOMINATED_ORACLE_FACTORY);
DelayedOracleFactory public delayedOracleFactory = DelayedOracleFactory(MAINNET_DELAYED_ORACLE_FACTORY);
IDelayedOracleFactory public delayedOracleFactory = IDelayedOracleFactory(MAINNET_DELAYED_ORACLE_FACTORY);
}

abstract contract CommonSepolia is Script {
Expand Down
16 changes: 9 additions & 7 deletions script/DeployOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract DeployEthUsdRelayerMainnet is Script, CommonMainnet {
vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK'));

chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_ETH_USD_FEED, MAINNET_ORACLE_INTERVAL
MAINNET_CHAINLINK_ETH_USD_FEED, MAINNET_CHAINLINK_SEQUENCER_FEED, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
);

vm.stopBroadcast();
Expand All @@ -36,21 +36,23 @@ contract DeployEthUsdRelayerMainnet is Script, CommonMainnet {
contract DeployLinkGrtEthOracles is Script, CommonMainnet {
IBaseOracle public _linkUSDRelayer;
IBaseOracle public _grtUSDRelayer;
IBaseOracle public _ethDelayedOracle;

function run() public {
vm.startBroadcast(vm.envUint('ARB_MAINNET_DEPLOYER_PK'));

_linkUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_ORACLE_INTERVAL
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_CHAINLINK_SEQUENCER_FEED, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
);
_grtUSDRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_ORACLE_INTERVAL
MAINNET_CHAINLINK_LINK_USD_FEED, MAINNET_CHAINLINK_SEQUENCER_FEED, MAINNET_ORACLE_INTERVAL, MAINNET_GRACE_PERIOD
);

_linkDelayedOracle = delayedOracleFactory.deployDelayedOracle(address(_linkUSDRelayer), MAINNET_ORACLE_INTERVAL);
_grtDelayedOracle = delayedOracleFactory.deployDelayedOracle(address(_grtUSDRelayer), MAINNET_ORACLE_INTERVAL);
_ethDelayedOracle =
delayedOracleFactory.deployDelayedOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER, MAINNET_ORACLE_INTERVAL);
delayedOracleFactory.deployDelayedOracle(_linkUSDRelayer, MAINNET_ORACLE_INTERVAL);
delayedOracleFactory.deployDelayedOracle(_grtUSDRelayer, MAINNET_ORACLE_INTERVAL);
delayedOracleFactory.deployDelayedOracle(
IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), MAINNET_ORACLE_INTERVAL
);

vm.stopBroadcast();
}
Expand Down
2 changes: 2 additions & 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_CAMELOT_RELAYER_FACTORY = 0x36645830479170265A154Acb726
address constant MAINNET_CHAINLINK_RELAYER_FACTORY = 0x06C32500489C28Bd57c551afd8311Fef20bFaBB5;
address constant MAINNET_DENOMINATED_ORACLE_FACTORY = 0xBF760b23d2ef3615cec549F22b95a34DB0F8f5CD;
address constant MAINNET_ALGEBRA_FACTORY = 0x1a3c9B1d2F0529D97f2afC5136Cc23e58f1FD35B;
address constant MAINNET_DELAYED_ORACLE_FACTORY = 0x9Dd63fA54dEfd8820BCAb3e3cC39aeEc1aE88098;

////////// RELAYERS //////////
// Camelot
Expand Down Expand Up @@ -101,6 +102,7 @@ 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;
address constant MAINNET_PROTOCOL_TOKEN = 0x000D636bD52BFc1B3a699165Ef5aa340BEA8939c;
address constant MAINNET_WETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
address constant ETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
Expand Down
21 changes: 0 additions & 21 deletions src/contracts/factories/DelayedOracleChild.sol

This file was deleted.

49 changes: 0 additions & 49 deletions src/contracts/factories/DelayedOracleFactory.sol

This file was deleted.

123 changes: 0 additions & 123 deletions src/contracts/oracles/DelayedOracle.sol

This file was deleted.

11 changes: 0 additions & 11 deletions src/interfaces/oracles/IDelayedOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ interface IDelayedOracle is IBaseOracle {
*/
event UpdateResult(uint256 _newMedian, uint256 _lastUpdateTime);

// --- Errors ---

/// @notice Throws if the provided price source address is null
error DelayedOracle_NullPriceSource();
/// @notice Throws if the provided delay is null
error DelayedOracle_NullDelay();
/// @notice Throws when trying to update the oracle before the delay has elapsed
error DelayedOracle_DelayHasNotElapsed();
/// @notice Throws when trying to read the current value and it is invalid
error DelayedOracle_NoCurrentValue();

// --- Structs ---

struct Feed {
Expand Down

0 comments on commit 4c1a79c

Please sign in to comment.