Skip to content

Commit

Permalink
add DeployWstethRethL2ValidityOracles
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 23, 2024
1 parent 55e4655 commit 8aa6501
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions script/DeployOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,47 @@ contract DeployLinkGrtEthOracles is Script, CommonMainnet {
vm.stopBroadcast();
}
}

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

contract DeployWstethRethL2ValidityOracles is Script, CommonMainnet {
IBaseOracle public _wstethETHRelayer;
IBaseOracle public _rethETHRelayer;

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

_wstethETHRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_WSTETH_ETH_FEED,
MAINNET_CHAINLINK_SEQUENCER_FEED,
1 days,
MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD
);
_rethETHRelayer = chainlinkRelayerFactory.deployChainlinkRelayerWithL2Validity(
MAINNET_CHAINLINK_RETH_ETH_FEED,
MAINNET_CHAINLINK_SEQUENCER_FEED,
1 days,
MAINNET_CHAINLINK_L2VALIDITY_GRACE_PERIOD
);

IBaseOracle _wstethUsdOracle = denominatedOracleFactory.deployDenominatedOracle(
_wstethETHRelayer, IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), false
);

IBaseOracle _rethUsdOracle = denominatedOracleFactory.deployDenominatedOracle(
_rethETHRelayer, IBaseOracle(MAINNET_CHAINLINK_L2VALIDITY_ETH_USD_RELAYER), false
);

IBaseOracle wstethOracle = delayedOracleFactory.deployDelayedOracle(_wstethUsdOracle, MAINNET_ORACLE_DELAY);
IBaseOracle rethOracle = delayedOracleFactory.deployDelayedOracle(_rethUsdOracle, MAINNET_ORACLE_DELAY);

wstethOracle.getResultWithValidity();
rethOracle.getResultWithValidity();

vm.stopBroadcast();
}
}

0 comments on commit 8aa6501

Please sign in to comment.