Chuyển đến nội dung chính
ZYGY Research ZYGY ResearchNền tảng nghiên cứu tài sản số
Tiếng Việt
← Thư viện câu hỏi
trading

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

Câu trả lời

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?

ethereumXem bản gốcCC BY-SA 4.0

Duyệt thêm câu hỏi