Skip to content
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

How to decode the contract function name and parameters from a Polygon transaction? #93

Open
imkane opened this issue Dec 17, 2022 · 1 comment

Comments

@imkane
Copy link

imkane commented Dec 17, 2022

Using this transaction: https://polygonscan.com/tx/0x1b4165c1093936b74803666c75edd720fbd1713b5f77160e3a726299fb04078d

I thought I could simply decode the Input Data to figure out the function name and parameters, so I can call that function directly from Nodejs.

However, it's just returning undefined 🤔

const inputData = "0x4ae301550000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b400000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000";

const decodedData = abiDecoder.decodeMethod(inputData);
console.log(decodedData);

Am I using this package incorrectly? Is there any other way to figure out the contract function name and parameters for this transaction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@imkane and others