Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

324
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda