ethereum - 如何用更少的gas调用WETH转账?
问题描述
我发现了两笔交易 A 和 B,
进行相同的湿转移,但气体更少
更少的gas 交易A
- WETH转账的温柔调试
- 调试信息-gasUsed 8826
{
"[FUNCTION]": "transfer",
"[OPCODE]": "CALL",
"from": {
"address": "0x55eb58655f8202ff839487886fedba2a1eb7b2d7",
"balance": "22398887127081365705"
},
"to": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"balance": "7634297606011867887263387"
},
"value": "0",
"input": {
"dst": "0x811beed0119b4afce20d2583eb608c6f7af1954f",
"wad": "3234978929533571285"
},
"output": {
"0": true
},
"gas": {
"gas_left": 896255,
"gas_used": 8862,
"total_gas_used": 103753
}
}
更多的气体交易B
- WETH转账的温柔调试
- 调试信息 - 12862
{
"[FUNCTION]": "transfer",
"[OPCODE]": "CALL",
"from": {
"address": "0x76338df6d82b20c3c61fba5a48ee59b9db18ffc1",
"balance": "866500922578987818"
},
"to": {
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"balance": "7276081970854472165085960"
},
"value": "0",
"input": {
"dst": "0x811beed0119b4afce20d2583eb608c6f7af1954f",
"wad": "4260000000000000000"
},
"output": {
"0": true
},
"gas": {
"gas_left": 262380,
"gas_used": 12862,
"total_gas_used": 37620
}
}
完全糊涂了,这种差异是怎么发生的?
解决方案
推荐阅读
- node.js - nodeJS应用程序中的两阶段提交
- go - 如何解码 base64 字符串并获取正确的字符,包括重音符号?
- pdf - Prestashop 使用用户名生成发票
- python - 如何在 wagtail 站点地图上将协议更改为 https?
- service-worker - 在 Service Worker 中导入 Dexie
- delphi - 如何在不关闭非模态表单的情况下将值从非模态表单传递回主表单
- android - 与机读旅行证件交互时,一系列 Android 设备的反应不同
- apache-spark - Spark 类 org/apache/spark/sql/types/DataType 的 Snappy 数据缺失依赖项
- ballerina - 是否可以为 Ballerina 服务定义默认资源?
- html - 一类中的不同边框颜色 *CSS*