ABI Guesser

This package allows you to take any ABI-encoded blob of data, such as calldata, return data, or anything else that can be parsed with abi.decode(), and reverse-engineer the types of the values inside that blob.

Note that this package will not be able to guess the types for any data which was encoded in a non-standard manner.

Installation

npm i @openchainxyz/abi-guesser

Usage

import { guessAbiEncodedData, guessFragment } from '@openchainxyz/abi-guesser'

const paramTypes: ParamType[] = guessAbiEncodedData(calldata)!;

const fragment: FunctionFragment = guessFragment(calldata)!;