Bitcoin Forum
December 01, 2026, 10:53:42 AM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Your ERC-20 transfer is expensive because of storage, not gas price  (Read 54 times)
khalidxpert (OP)
Member
**
Offline

Activity: 275
Merit: 31

XpertCreation - https://xpertcreation.com


View Profile WWW
November 25, 2026, 12:30:01 PM
 #1

Everyone watches the gas price and ignores where the gas goes. For a plain USDT or any ERC-20 transfer, the cost is dominated by storage writes, not arithmetic:

    [] Writing a storage slot from zero to non-zero costs 20,000 gas. [] Updating an existing non-zero slot costs 5,000 gas.
  • Clearing a slot refunds a capped amount (currently 4,800 gas per slot, capped at one fifth of the transaction's total gas).
That is why the same transfer costs different amounts depending on the recipient. If the recipient's token balance slot is currently zero — a brand new wallet, a fresh exchange deposit address — the sender pays to create it. 20,000 gas is roughly four times a normal update.

Practical consequences:

First transfer to a new address always costs more than the second one. If you are sending small amounts to many fresh addresses, budget for the creation, not the transfer.

Batching helps when the storage pattern is the same. Ten zero-to-non-zero writes cost the same as ten separate transactions in gas terms; you save on the 21,000 base cost per transaction and on calldata, not on the storage.

A contract that pays twenty people from one call is not automatically cheaper than twenty transfers, unless those slots already exist. It is cheaper in transaction overhead only.

Before optimising anything, run the numbers on a fork:
Code:
cast estimate --rpc-url $RPC --value 0 $TOKEN "transfer(address,uint256)" $TO $AMOUNT
Do it twice — once to a fresh address, once to an address that already holds the token. The difference is the storage, and it is usually the largest line item in the bill.


X P E R T C R E A T I O N We build it, we run it, we keep it online. Django · React · Linux VPS · Custom platforms xpertcreation.com

3) Badi (Sr. Member+)

X P E R T C R E A T I O N Full-stack development — from database schema to Nginx.

› Django + React web platforms › Linux VPS setup, deployment & hardening › Crypto payments, wallets & on-chain integrations

xpertcreation.com
MAAManda
Legendary
*
Offline

Activity: 2422
Merit: 1103


I'm a Nicegang, 🫸🏻Izin...


View Profile WWW
November 26, 2026, 10:47:18 AM
 #2

Wow, you have a good level of knowledge, considering the low ranking of your forum account right now. You're correct that sending assets to an address that has never been used before will incur higher costs, it incurs higher costs due to storage expenses.

However, despite your good knowledge in this sector, I notice that you have been tagged as an "AI Spammer". It's truly disappointing that the knowledge you have doesn't come from your own mind.

R


▀▀▀▀▀▀▀██████▄▄
████████████████
▀▀▀▀█████▀▀▀█████
████████▌███▐████
▄▄▄▄█████▄▄▄█████
████████████████
▄▄▄▄▄▄▄██████▀▀
LLBIT|
4,000+ GAMES
███████████████████
██████████▀▄▀▀▀████
████████▀▄▀██░░░███
██████▀▄███▄▀█▄▄▄██
███▀▀▀▀▀▀█▀▀▀▀▀▀███
██░░░░░░░░█░░░░░░██
██▄░░░░░░░█░░░░░▄██
███▄░░░░▄█▄▄▄▄▄████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█████████
▀████████
░░▀██████
░░░░▀████
░░░░░░███
▄░░░░░███
▀█▄▄▄████
░░▀▀█████
▀▀▀▀▀▀▀▀▀
█████████
░░░▀▀████
██▄▄▀░███
█░░█▄░░██
░████▀▀██
█░░█▀░░██
██▀▀▄░███
░░░▄▄████
▀▀▀▀▀▀▀▀▀
||.
|
▄▄████▄▄
▀█▀
▄▀▀▄▀█▀
▄▄░░▄█░██░█▄░░▄▄
▄▄█░▄▀█░▀█▄▄█▀░█▀▄░█▄▄
▀▄█░███▄█▄▄█▄███░█▄▀
▀▀█░░░▄▄▄▄░░░█▀▀
█░░██████░░█
█░░░░▀▀░░░░█
█▀▄▀▄▀▄▀▄▀▄█
▄░█████▀▀█████░▄
▄███████░██░███████▄
▀▀██████▄▄██████▀▀
▀▀████████▀▀
.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
░▀▄░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░▄▀
███▀▄▀█████████████████▀▄▀
█████▀▄░▄▄▄▄▄███░▄▄▄▄▄▄▀
███████▀▄▀██████░█▄▄▄▄▄▄▄▄
█████████▀▄▄░███▄▄▄▄▄▄░▄▀
████████████░███████▀▄▀
████████████░██▀▄▄▄▄▀
████████████░▀▄▀
████████████▄▀
███████████▀
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
▄███▀▄▄███████▄▄▀███▄
▄██▀▄█▀▀▀█████▀▀▀█▄▀██▄
▄██▀▄███░░░▀████░███▄▀██▄
███░████░░░░░▀██░████░███
███░████░█▄░░░░▀░████░███
███░████░███▄░░░░████░███
▀██▄▀███░█████▄░░███▀▄██▀
▀██▄▀█▄▄▄██████▄██▀▄██▀
▀███▄▀▀███████▀▀▄███▀
▀████▄▄▄▄▄▄▄████▀
▀▀███████▀▀
OFFICIAL PARTNERSHIP
SOUTHAMPTON FC
FAZE CLAN
SSC NAPOLI
CryptoPlayGuide
Newbie
*
Offline

Activity: 12
Merit: 0


View Profile
Today at 10:08:08 AM
 #3

Good write-up. A few details that change the numbers a bit, in case anyone checks this on-chain and gets something different:

  • Since Berlin (EIP-2929) the first access to a storage slot in a transaction is "cold" and costs an extra 2,100 gas. So a zero to non-zero balance write is effectively 20,000 + 2,100 = 22,100 when cold, and the 5,000 figure for updating a non-zero slot is 2,900 + 2,100 cold (assuming no access list pre-warms the slot).
  • A plain transfer writes two balance slots, not one: the recipient's and the sender's (transferFrom with a limited allowance writes a third). If the sender sends their whole balance, their slot goes to zero and earns the 4,800 refund from EIP-3529, capped at one fifth of gas used. That lowers the gas actually paid, not the gas limit that cast estimate / eth_estimateGas returns.
  • Some tokens touch more storage than a plain ERC-20 (fee-on-transfer, blacklist checks, voting checkpoints), so simulating the exact call against current state is the only reliable way to know what a given transfer will cost.

The same pattern exists outside Ethereum. On Tron, a USDT (TRC-20) transfer to an address whose current USDT balance is zero costs noticeably more energy than one to an address that already holds some, for the same reason: the balance entry goes from zero to non-zero. That applies again if an address empties its balance and later receives more.

On rollups there is also a separate data/L1 fee on top of execution gas, so watching only the L2 gas price can mislead in a different way.

(Written with AI assistance, checked against the EIP texts.)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!