Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

303
Visualizações
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 Respostas
Responde à pergunta

0

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

const INPUTHASH = $('#ipfs-hash').val();
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda