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

300
Vistas
JS constant inside another constant with ethers.js

I'm using ethers.js to encode in ABI a IPFS hash provided by a text box on an html page, in order to save it on the blockchain. To do that, I have an input id'd as "ipfs-hash", called with a variable. An then, another variable which encodes it. Nevertheless, this last step doen't work, and when I try to take the hash from a variable the code breaks. However, the second variable seems to work fine when I change

INPUTHASH

variable for an actual value.

'Qm...'
const INPUTHASH =  $('#ipfs-hash').html //Direct input from text box                
const ABIOUTPUT = ethers.utils.defaultAbiCoder.encode([ 'string' ], [ INPUTHASH ] );
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Solved! It was a problem with Jquery.js, not ethers.js.

const INPUTHASH = $('#ipfs-hash').val();
about 4 years ago · Juan Pablo Isaza Denunciar
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