In the createOrder function, the safeApprove method is used to approve token transfers for gmxRouter. However, using safeApprove in this context is risky because of the potential for the "SafeERC20: approve from non-zero to non-zero allowance" revert . This occurs if the external contract doesn't consume the entire approved allowance and the allowance is then adjusted again to a non-zero value. To avoid this issue, safeIncreaseAllowance should be used instead of safeApprove.
also safeApprove is depreciated
SafeERC20.safeApprove reverts when a non-zero approval is changed to a non-zero approval.
Transaction Failure: The safeApprove method might lead to failed transactions, especially if the external contract doesn’t consume the full allowance or attempts to reset the allowance value in subsequent transactions.
Manual Review
Consider using safeIncreaseAllowance.
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.