Can someone explain why the same WFTM transfer costs one time 38k and another time 23k gas?

Here are the two transactions:



1 Answer 1


This is related to the gas metering of storage changes.

When you transfer a token, the balance sheet inside the token contract is updated. This means you need to adjust the balance of the sender and the receiver.

When a storage slot was originally 0 and is changed to a non-zero value, you need to pay 20k gas. Otherwise you pay 5k gas. And you change the value from non-zero to zero you get a gas refund at the end of transaction of 15k gas.

Looking at the second link you shared you can see that 0x3099e12ca83c51e9b82ea6c5a08723aed4912068 transferred all tokens available, therefore setting the balance of that account to zero. This triggered the gas refund of 15k gas, which is the difference in gas costs.

  • Many thanks that sounds interesting.
    – flo
    Jan 13, 2022 at 18: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.