Library for decoding function name and arguments from EVM calldata
Warning: This project is in beta state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.
npm install evm-calldata-decode --save
The project also expects peer dependency @ethersproject
or the individual modules @ethersproject/abi, @ethersproject/bignumber, @ethersproject/bytes, @ethersproject/keccak256, @ethersproject/strings
import { decodeCallData } from 'evm-calldata-decode'
const calldata = '0x1234567800000...'
const abi = '[{"inputs": [...],"name": "mint","type": "function", ...}, ...]'
decodeCallDataWithSignatureDB(calldata, abi)
NOT IMPLEMENTED YET
Attempts to decode calldata with ABI retrieved from Etherscan or Sourcify.
const calldata = '0x1234567800000....'
const contract_address = '0x0....0'
decodeCallDataWithSignatureDB(calldata, contract_address)
NOT IMPLEMENTED YET
Attempts to decode calldata with a signature retrieved from Ethereum Signature Database. This is a last resort option if only the calldata are known.
const calldata = '0x1234567800000....'
decodeCallDataWithSignatureDB(calldata)