-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode transaction input field #33
Comments
Please provide an example, I have no clue what you are talking about ;) |
Let me explain: What I'm trying to do is the inverse of that : given an 'input' field of a given transaction, retrieve the method and the parameters. We have this Abi::decodeMethod but it looks like it's just decoding an output, not the method and parameters. Example : trx 0x9d6e0b717c36f3cb9b4478daed168b02024d8b41f6b0f105a2e904e1996ce796 Decoding would be : So I guess this method is not part of the library ? |
I assume you have the ABI for each input you want to decode available. Without it It will not work, as the Method ID is (part of) a keccac hash which you can't reverse engineer. If you use truffle to compile your contracts you get a list of available function hashes from truffle compile. I'm still not sure If I fully understand your use case. |
Sorry my example was about ERC20 tokens and contracts, but I realize I didn't mention it. $abi would be initialized with the public ERC20 ABI Does it make sense ? |
Yes. I would suggest Step one like Step1 Get the method:
Step2 is all ready in place:
|
I don't think decodeMethod function is what we need for step 2. |
Any updates or alternatives? |
I'm having the same difficulty @sebnyc did you get a solution? |
I'm starting to use your library, it looks fantastic.
I would like to decode the 'input' field of transactions, using the ABI of the involved contract (especially for ERC20 contracts). Is there a built-in method to do so ?
The text was updated successfully, but these errors were encountered: