1

I had the understanding that Approval in the same block as a Swap had to have a higher gas price as to be processed before the Swap when the block is being produced; that's until I found blocks on the mainnet where Approval came after the Swap, just how is this allowed?

For example this swap had no previous approvals and the same block approval was positioned after the swap in the produced block:

# Block # Block pos Function Gas Price Txn
17915586 10 Swap 37.7965 Gwei 0xc54dc9f3fbb483f2f039e201e5d31b3ad2da067b0bbe2e2882adbe826d36b4b0
17915586 11 Approve 37.7965 Gwei 0x5efa7e8a990761142d32902dfcdbbf4df09bafd4ba547c47bcb3b3f7191d2f25

Here's links to these two txns: https://etherscan.io/tx/0xc54dc9f3fbb483f2f039e201e5d31b3ad2da067b0bbe2e2882adbe826d36b4b0 https://etherscan.io/tx/0x5efa7e8a990761142d32902dfcdbbf4df09bafd4ba547c47bcb3b3f7191d2f25

-TIA

1 Answer 1

1

Here's what happened:

  • The first transaction is swap from some ETH to the iGP token.

  • The second transaction is approval for subsequent iGP trading.

The swap does not need an approval because the user is not sending any token to the contract, they are sending ETH, which is the native currency of the Ethereum blockchain and is handled in a specific way both by the chain and by Uniswap contracts.

The user probably fired the approval tx immediately after the swap tx because they want to be able to sell iGP without any delay at the time they want to, in the future.

2
  • That seems logical now that I´ve understood that approvals are only for with swapping ERC-20 tokens and not when swapping with native currency. Thank you. Nov 18, 2023 at 17:15
  • 1
    @blockchainmassacre the approvals not needed for ETH because you can send ETH along with the rest of the transaction data. With ERC-20 tokens that's not really possible. You need to tell the destination contract to instead take some ERC-20 tokens from your wallet; which needs the approval first.
    – kfx
    Nov 18, 2023 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.