繁体   English   中英

Web3 python:我如何解码输入数据

[英]Web3 python: how can I decode Input Data

使用 web3 (python3) 我正在尝试解码 BscScan 上看到的 BSC 事务的 InputData 在此处输入图像描述

在某些解决方案中,我发现正在使用以下代码:

import web3
from web3.contract import Contract
...
contract = web3.eth.contract(address=Web3.toChecksumAddress(tokenAddress), abi=abi)
contract.functions.decode_function_input(transaction.input)

但是,abi 似乎没有定义这个函数“decode_function_input”,因为我收到了一个错误:

"web3.exceptions.ABIFunctionNotFound: ("The function 'decode_function_input' was not found in this contract's abi. ", 'Are you sure you provided the correct contract abi?')"

我 100% 认为 abi 是正确的。 此外,在 BscScan 合约原始视图中,函数“decode_function_input”确实不存在。

任何其他解决方案,如何解码输入数据

兄弟,不是contract.functions.decode_function_input ,是contract.decode_function_input()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM