DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: medium
Valid

Hardcoded Aggregator Sequencer up Address for Arbitrum and Avalanche

Summary

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.

Vulnerability Details

The sequencer Address is hard coded but is only available on ARB.

=> https://arbiscan.io/address/0xfdb631f5ee196f0ed6faa767959853a9f217697d#readContract.

/**
* @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 {
// L2 Sequencer check
(
/*uint80 roundID*/,
int256 answer,
uint256 startedAt,
/*uint256 updatedAt*/,
/*uint80 answeredInRound*/
@audit>> ) = AggregatorV2V3Interface(sequencerUptimeFeed).latestRoundData();
@audit>> bool isSequencerUp = answer == 0;
@audit>> require(isSequencerUp, "sequencer is down");
// Make sure the grace period has passed after the sequencer is back up.
@audit>> uint256 timeSinceUp = block.timestamp - startedAt; //BUG ON AVALANCHE CHECK FOT STARTTIME NOT ZER0
@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);
}

Avalanche =>

Impact

Checks for sequencers will not be enforced on Avalanche.

Tools Used

Manual Review

Recommendations

Do not hard code the Sequencer Address as it is not available on Avalanche.

Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_Avalanche_has_no_sequencer

Likelihood: High, run and runNextAction will revert. Impact: Low, any deposit will be retrieve thanks to cancelFlow.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.