1

I am getting stuck decoding data transaction from a swap using uniswap protocol (Uniswap V3: Router 2 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45). In other words, I'd like to know if it exists a function that given a smart contract address and the data of the transaction, returns the decoded data (the path of all the smart contract addresses that the transaction executes).

I tried to use the method decode_function_input from Web3, but it worked only for certain protocol.

When I tried for a swap on uniswap or a transaction on opensea I did not get any results.

address = 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45

data = 0x5ae401dc0000000000000000000000000000000000000000000000000000000063bd8fab00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000dc06b8c890e100ba78888fede3d0c4bc769f41b400000000000000000000000000000000000000000000000000b08416c4bb7d2e0000000000000000000000000000000000000000000000000000000003eb71f4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

contract_instance = w3.eth.contract(address=address, abi=abi) func_obj, func_params = contract_instance.decode_function_input(data) print(func_params)

I don't get any result although the addresses I want to retrieve are in the data. I want a way to convert the data to addresses.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
evan
  • 11
  • 2

0 Answers0