Possible incorrect gas price calculation on EIP-1559 chains
Arbitrum and Avalanche use EIP-1559 gas pricing where tx.gasprice is not reliable.
The positionExecutionFee
calculation in the gmxProxy contract's settle
function uses tx.gasprice
directly, which can cause problems.
The actual gas price on these chains is calculated as: block.basefee + tx.priorityFeePerGas
Using tx.gasprice instead leads to paying more gas fees than needed, or failed transactions when gas fees are too low.
Users can pay more gas fees than needed, or fail transactions when gas fees are too low.
Manual Review
Calculate the real gas price by adding base fee and priority fee:
If the sender does not provide enough, the transaction to create the order won't be included in the current block: no problem. If the user provides more, they will pay more: user mistake. Moreover, the `refundFee` is set to `true` only when the keeper is the caller, preventing manipulation.
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.