Skip to content

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

@imkane

Description

@imkane

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions