The createPerpMarket function in the GlobalConfigurationBranch contract lacks a check to prevent the creation of markets with duplicate IDs. This could lead to unintentional overwriting of existing markets.
In the createPerpMarket function, a new market is created using the provided marketId. However, there is no verification to ensure that a market with the given marketId doesn't already exist.
Without a check for existing markets, calling this function with an marketId that's already in use would overwrite the existing market data.
Overwriting of existing markets, resulting in loss of market data and configurations. Also, there could be a disruption of trading activities on the overwritten markets.
Manual code review
Implement a check to ensure the marketId is not already in use before creating a new market with the same ID.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.