2

我正在尝试在 Moonbeam EVM(兼容 Polkadot EVM 的平行链)中获取签署以下交易的地址。通过加载合同 ABI,我可以通过以下方式获取调用参数:

from web3 import Web3
w3 = Web3(Web3.HTTPProvider(endpoint))
contract = w3.eth.contract(address=contract_address, abi=abi)
func_obj, func_params = contract.decode_function_input(input)

但是,我还没有找到从 v,r,s 值中获取签名地址的方法。签名地址是0xb01744745fbBebE6A0Da674F8f45fD1e14D5B488并且 Subscan 可以解码(不知道如何),外部可以在这里看到https://moonbeam.subscan.io/extrinsic/333456-3

这是外挂的内容:

{
  "extrinsic_hash": "None",
  "extrinsic_length": 358,
  "call": {
    "call_index": "0x3400",
    "call_function": "transact",
    "call_module": "Ethereum",
    "call_args": [
      {
        "name": "transaction",
        "type": "Transaction",
        "value": {
          "nonce": [
            4,
            0,
            0,
            0
          ],
          "gas_price": [
            100000000000,
            0,
            0,
            0
          ],
          "gas_limit": [
            81203,
            0,
            0,
            0
          ],
          "action": {
            "Call": "0x0000000000000000000000000000000000000800"
          },
          "value": [
            0,
            0,
            0,
            0
          ],
          "input": "0x829f5ee30000000000000000000000006ac4b6725efd8a1cb397884769730094e854efd4000000000000000000000000000000000000000000000004fcc1a89027f00000000000000000000000000000000000000000000000000000000000000000018b0000000000000000000000000000000000000000000000000000000000000000",
          "signature": {
            "v": 2604,
            "r": "0x5c13ca196ecb21a46827d2959282b67b807fc733feb314832a5597f2c5e06df4",
            "s": "0x62646696b3afa36444924ca8813e237faec7de9f8d044c3cd2f589293dcf5f73"
          }
        }
      }
    ],
    "call_hash": "0x92b544513124ed16ead74de9784661d46e5d8b839a232050ccf3348fc73a0b8a"
  }
}

那么如何从上述数据中获取地址呢?我已经尝试了很多方法,但没有找到任何能带来这种结果的东西。

PS我知道在这种特定情况下,我可以从调用触发的事件之一中获取该地址,但我不想使用该方法,而是想解码签署交易的地址

4

0 回答 0