I m 试图读到与UniswapV3号公司有关的待决交易,使用该代码作为同文。
address_router = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
with open("abiRouterUniswapV3.json", "r") as myFile:
data = myFile.read()
abiRouter = json.loads(data)
contractRouter = w3.eth.contract(address=address_router, abi=abiRouter)
block_filter = w3.eth.filter( pending )
def handle_event(event):
try:
tx = w3.eth.getTransaction(event)
tx_to = tx.to
except Exception:
pass
else:
if tx_to == "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45": #filtering only UniswapV3
input_decoded = contractRouter.decode_function_input(tx.input)
print("hash: ", tx.hash.hex())
print(input_decoded)
然而,Im利用UniswapV3航道公司ABI制造合同路子,使解密成为可能。 当功能是多功能时,它没有将数据编码在投入中。 举例来说,当职能是多种调动时,它就产生了这一结果。
hash: 0x907b4c17bc525786960c4b2373c1b60cafc3f287e95cf5948432e4e71b25dd00 (<Function multicall(uint256,bytes[])>, { deadline : 1663819751, data : [b G+Cxf3x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x1ckxf5&4x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x029xc5x0fx85cxf09@5xf5x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x80x00x00x00x00x00x00x00x00x00x00x00x00x0fxfbxc9xc2xa8x8dx98;xa1xe3xe6(x11Yxe9x98xa4xc9x1aCx00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x02x00x00x00x00x00x00x00x00x00x00x00x00xc0*xaa9xb2#xfex8d x0eO xeaxd9x08<ulxc2x00x00x00x00x00x00x00x00x00x00x00x00x12xeexc9x13"x95xc1xfd|xabx0b,xfdxe6zx15xaax94Wxd7 ]})
您可以看到数据为t decode
我的法典中有什么错误,或我所失踪的是什么? 我将真正赞赏你能够向我提供的任何帮助或指导。