Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
Error: Unable to decode revert reason using getReverReason()

I am trying to understand why an ethereum transaction reverted by using getReverReason() from eth-revert-reason. I first tried using their example which is:

console.log(await getRevertReason('0x6ea1798a2d0d21db18d6e45ca00f230160b05f172f6022aa138a0b605831d740'))

but I get the error "await is only valid in async function". When I tried to run it inside the async function as below:

const Web3 = require("web3");
const ethers = require('ethers');
const getRevertReason = require('eth-revert-reason');
const txHash = '0x6ea1798a2d0d21db18d6e45ca00f230160b05f172f6022aa138a0b605831d740'

// Failed with revert reason "Failed test"
async function reason() {
    await getRevertReason(txHash)
}

console.log(reason())

I always get the same result, regardless of the Transaction Hash:

Error: Unable to decode revert reason.

Could you please help me?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!