Due to the BTC/USD market returning a non-contract address as indexToken, any calls to balanceOf() in PerpetualVault.sol revert, rendering the contracts incompatible with this key GMX market.
When a PerpetualVault is initialized, the indexToken address is set by calling getMarket() from the GMXReader:
According to the README, these contracts should be compatible with wBTC (i.e. the BTC/USD GMX market). However, in the BTC/USD market, marketinfo.indexToken is not a contract, so calling balanceOf() will revert.
Here's the indexToken address for the BTC/USD market on Arbitrum: https://arbiscan.io/address/0x47904963fc8b2340414262125af798b9655e58cd
indexToken.balanceOf() is used throughout the PerpetualVault.sol contract making Gamma's implementation incompatible with this key market.
Contracts incompatible with key GMX market.
Manual review
Consider using the long token instead of the index token for these markets, however, this can cause issues if you ever want to launch on markets where the long token doesn't equal the index token.
Impact: High. 1/3 of the in-scope tokens are DoS, and WBTC is an important token. Likelihood: Low. It would be an admin error to integrate it, knowing that indexToken should be equal to longToken. However, the token is in-scope, meaning it should have at least a low likelihood.
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.