首页 > 解决方案 > 如何用更少的gas调用WETH转账?

问题描述

我发现了两笔交易 A 和 B,

进行相同的湿转移,但气体更少

更少的gas 交易A

{
  "[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

{
  "[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
  }
}

完全糊涂了,这种差异是怎么发生的?

标签: ethereumsolidity

解决方案


推荐阅读