The Sequencer Address is hard-coded to an address that is available on Arbitrum but not available on Avax. This means the sequencer check will not work on Avalanche.
The sequencer Address is hard coded but is only available on ARB.
* @notice Initializes the contract.
* @dev Sets the initial threshold value and initializes inherited contracts.
*/
function initialize() external initializer {
__Ownable2Step_init();
@audit>> sequencerUptimeFeed = AggregatorV2V3Interface(0xFdB631F5EE196F0ed6FAa767959853A9F217697D);
}
function _validatePrice(address perpVault, MarketPrices memory prices) internal view {
(
,
int256 answer,
uint256 startedAt,
,
@audit>> ) = AggregatorV2V3Interface(sequencerUptimeFeed).latestRoundData();
@audit>> bool isSequencerUp = answer == 0;
@audit>> require(isSequencerUp, "sequencer is down");
@audit>> uint256 timeSinceUp = block.timestamp - startedAt;
@audit>> require(timeSinceUp > GRACE_PERIOD_TIME, "Grace period is not over");
address market = IPerpetualVault(perpVault).market();
IVaultReader reader = IPerpetualVault(perpVault).vaultReader();
MarketProps memory marketData = reader.getMarket(market);
_check(marketData.indexToken, prices.indexTokenPrice.min);
_check(marketData.indexToken, prices.indexTokenPrice.max);
_check(marketData.longToken, prices.indexTokenPrice.min);
_check(marketData.longToken, prices.indexTokenPrice.max);
_check(marketData.shortToken, prices.shortTokenPrice.min);
_check(marketData.shortToken, prices.shortTokenPrice.max);
}
Checks for sequencers will not be enforced on Avalanche.
Do not hard code the Sequencer Address as it is not available on Avalanche.