The GmxProxy contract implements an unsafe token approval pattern that fails to handle tokens requiring approval reset (like USDC) properly. This can lead to failed transactions and system unavailability, particularly on Arbitrum and Avalanche networks.
On arbitrum and avalanche networks it requires an implementation that resets approval on USDC.
But the createOrder function performs direct approval without considering the specific token requirements and does not reset approval to 0 before setting a new value which can cause failed transactions for USDC and even system unavailability.
Failed transactions
System unavailability for USDC
User initiates a transaction with USDC
GmxProxy attempts to approve gmxRouter for amount X
Previous approval exists with amount Y
USDC contract reverts the transaction due to non-zero existing allowance
Order creation fails
System becomes temporarily unusable for USDC operations
Manual review
Always reset approval to 0 before setting a new value for USDC.
USDT or other unusual ERC20 tokens: out of scope. For the other reports: No proof that the allowance won't be consumed by the receiver.
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.