DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Possible incorrect gas price calculation on EIP-1559 chains

Title

Possible incorrect gas price calculation on EIP-1559 chains

Summary

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.

Details

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.

Impact

Users can pay more gas fees than needed, or fail transactions when gas fees are too low.

Tools Used

Manual Review

Recommendations

Calculate the real gas price by adding base fee and priority fee:

uint256 gasPrice = block.basefee + tx.priorityFeePerGas;
Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

invalid_tx-gasprice_user_manipulation

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.