MAX_PNL validation inconsistency

Hi everyone, I found a small issue: during the execution of a GLV deposit, the code compares the max PnL with MAX_PNL_FACTOR_FOR_WITHDRAWALS instead of MAX_PNL_FACTOR_FOR_DEPOSITShttps://github.com/gmx-io/gmx-synthetics/blob/10cfbce6144ade8e9d5cd8c811573955bcd1c132/contracts/glv/glvDeposit/ExecuteGlvDepositUtils.sol#L188-L189

Even though the correct key is used earlier - https://github.com/gmx-io/gmx-synthetics/blob/10cfbce6144ade8e9d5cd8c811573955bcd1c132/contracts/glv/glvDeposit/ExecuteGlvDepositUtils.sol#L99.

It’s a low-severity bug, and since it’s out of scope for your bug bounty program and doesn’t pose any major risk, I decided to just mention it here.

1 Like

Appreciate for flagging this we have shared this with the dev team

Thanks for bringing this up @typicalHuman.