The main function is to add liquidity to GMX and generate yield, but this cannot happen because the parameters for creating a deposit are incorrectly configured with address(0) for longTokenSwapPath and shortTokenSwapPath.
If we try to perform any function to add liquidity like deposit/rebalancing etc., the protocol throws an error. Let's see it step by step:
This is the flow of what will happen:
The interface is GMX ExchangeRouter and calls createDeposit
.
Then DepositHandler.sol.createDeposit() calls DepositUtils.createDeposit()
DepositUtils.sol.createDeposit inside the function executes:
MarketUtils.validateSwapPath(dataStore, params.longTokenSwapPath);
MarketUtils.validateSwapPath(dataStore, params.shortTokenSwapPath);
For the validation of these parameters.
Next, in MarketUtils.sol.validateSwapPath() calls validateSwapMarket()
Finally, calls validateEnabledMarket()
https://github.com/gmx-io/gmx-synthetics/blob/228f2155a69a1be3e99614b4ade0f65e86b0209b/contracts/market/MarketUtils.sol#L192-L203
It will throw an error since the market does not exist
High, the protocol is useless without this function working correctly.
Manual code Review
Add the correct exchange path as they did in the Liquidity withdrawal.
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.