0

Hash:0xf45f14b3eafa1867deafe6cdcddf0c751da125744ddcef0aa3e9c34221ecca83

When I was trying to decode the BSC input data by python,

TokenContract=web3.eth.contract(address=contract, abi=abi)
transaction = web3.eth.getTransaction(hash)
TokenContract.decode_function_input(transaction.input)

it always show

'Could not find any function with matching {0}'.format(identifier)'
'ValueError: Could not find any function with matching selector'

I search the problem for a long time, still can't find the solution. Can anyone help me out?

5
  • It could be an incorrect abi, a bug in web3.py. Are you sure the abi file correspond to the contract?
    – Ismael
    Sep 14 at 22:59
  • @Ismael I'm not sure. I use a common abi, what confuses me is some of TX input data can be decoded, some can't. Would you try to decode the TX I mention.
    – higgs
    Sep 16 at 8:25
  • web3.py uses the abi to code the transaction's input field. If you don't have the correct abi it won't be able to decode it. In this case you can get the contract from the contract page on bscscan.com. See this question ethereum.stackexchange.com/questions/70340/….
    – Ismael
    Sep 17 at 2:29
  • @Ismael Already tried, won't work. You can try it yourself.
    – higgs
    Sep 20 at 9:04
  • If you have a repo ready to try I might, but I don't have enough time to write the complete code needed.
    – Ismael
    Sep 20 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.