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

156
Views
resultado asíncrono no resuelto en web3

Estoy jugando Ethernaut Nivel 3, así que escribí el siguiente código para recuperar el valor de "suposición":

 async do_guess => { let no = await web3.eth.getBlockNumber() let block = await web3.eth.getBlock(no) let factor = new web3.utils.BN('57896044618658097711785492504343953926634992332820282019728792003956564819968') let result = new web3.utils.BN(block.hash) let tmp = result.div(factor) return tmp.toString() } let value = await do_guess() console.log(value)

Pero el valor siempre es "indefinido" de alguna manera, ¿alguien sabe qué está mal?

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

No está definido porque ese es el valor de retorno de la última declaración que se ejecutó en su consola, es probable que su promesa nunca se resuelva.

about 4 years ago · Santiago Gelvez Report
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!