Skip to content

PacificOceanSailor/revert-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

revertDecoder — Quick Start

1 · Install

npm i ethers dotenv            # node ≥ 18 required

2 · Create a .env file

RPC_1=https://base.llamarpc.com
RPC_2=https://base.llamarpc.com
TX_HASH=0xc7342688787d01cfd6574f3fd9774fd7c9e36a03e4603c047b51b53e24d22b91

ABI='[{"type":"error","name":"MyError","inputs":[]}]'

LOCAL_PORT=8544   # port Anvil will bind to (use another one if 8545 is busy)

RPC_1 is used for basic checks and can be a free RPC. RPC_2 is used if the first one doesn't work — it's better if it's a paid or self-hosted RPC, because it handles deeper analysis.

3 · Run

node revert_decoder.js

The script prints the method used (eth_call or debug_traceTransaction) and the decoded error. That’s it.

4 · Example output

Approach: eth_call on RPC_1-fork
NotOwner(
  address caller: 0x51C0...BEEF
)

What it means

  • Approach shows which path delivered the revert data (eth_call via the fork in this case; fallback would say debug_traceTransaction).
  • The lines beneath are the decoded custom error—here NotOwner—plus each argument in a readable form.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published