How can I decode metamask's swap input data?
I am using the python web3/etherscan api and I am not able to decode the input data from the metamask swaps.
I read that metamask uses the erc20 standard, so I used this as abi: https://ethereumdev.io/abi-for-erc20-contract-on-ethereum/ (I do this because I could not get the abi from the contract with web3.)
metamask_router = web3.toChecksumAddress('0x881d40237659c251811cec9c364ef91dc08d300c') metamask_contract = web3.eth.contract(address= metamask_router, abi=erc20_abi) decoded_input = metamask_contract.decode_function_input(transaction['input'])
(The transaction is taken from)
transaction = eth.get_proxy_transaction_by_hash(txhash)
ValueError: Could not find any function with matching select
Actually what I just need to know if the swap is a sell or a buy, but I can't find the way.