npm i ethers dotenv # node ≥ 18 requiredRPC_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.
node revert_decoder.jsThe script prints the method used (eth_call or debug_traceTransaction) and the decoded error. That’s it.
Approach: eth_call on RPC_1-fork
NotOwner(
address caller: 0x51C0...BEEF
)
- Approach shows which path delivered the revert data (
eth_callvia the fork in this case; fallback would saydebug_traceTransaction). - The lines beneath are the decoded custom error—here
NotOwner—plus each argument in a readable form.