본문으로 이동
ZYGY Research ZYGY Research디지털 자산 리서치 플랫폼
한국어
← 질문 자료실
trading

Why do these two Ethereum transactions have different gas usages? Can't explain it from the GETH EVM debug traces

답변

One of the reason for the gas cost not being the same would be that one account did not have any usdc before the transaction and the other already had some. It cost more gas to set a 0 value to non zero than non zero to non zero.
For instance. The new account does not have his address written in the usdc balance mapping. So the contract would have to record the address and set the balance. The other account already have his address written and we just updated the balance.
See;
Why does zero to non-zero in storage take higher gas?

ethereum원문 보기CC BY-SA 4.0

더 많은 질문 보기