Replies: 2 comments 2 replies
-
Once you get the const iface = new ethers.utils.Interface(abi);
const decodedArgs = iface.decodeFunctionData(tx.input.slice(0,10), tx.input)
const functionName = iface.getFunction(tx.input.slice(0,10)).name |
Beta Was this translation helpful? Give feedback.
2 replies
-
I know you might not see this because this post is so old, but in case you do, I had a quick question. I am able to "decode" the data in the sense that it prints out a bunch of stuff including a "result" array of size four, which I presume contains the function call and parameter that I am actually looking for. However, each item in this array is still encoded. Any idea how to decode it further? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm fetching transaction data using Etherscan API. This is the example result I'm getting:
Now I need to figure out the contract method, e.g. TransferOwnership, stakeTokens and input parameters it is taking for this transaction. I'm looking at https://docs.ethers.io/v5/api/utils/abi/interface/#Interface--decoding but couldn't find anything related to this. @ricmoo
This is an exception issue
Beta Was this translation helpful? Give feedback.
All reactions