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

154
Views
¿Cómo intercambiar ETH con WETH usando UniswapV2?

Estoy tratando de cambiar ETH por su equivalente en WETH usando UniswapRouterV2 y ethers.js, pero no sé qué dirección poner como ETH en la matriz de ruta, ya que no tiene una, así que hágamelo saber. estoy haciendo mal

 await this.uniswapRouter.swapETHForExactTokens( ethers.provider.getBalance(attacker.addres), // amountOut [0, this.weth.address], // path: what should it be instead of 0? attacker.address, // to (await ethers.provider.getBlock('latest').timestamp) * 2, // deadline {value: ethers.provider.getBalance(attacker.addres)} // msg.value )
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Acabo de recibirlo. Fue muy simple y el contrato UniswapRouterV2 no fue necesario en absoluto. Uno tiene que ejecutar la función de depósito del contrato WETH y el contrato devuelve ETH. Algo como esto:

 await this.weth.connect(attacker).deposit({value: ethToWETHAmount})
about 4 years ago · Juan Pablo Isaza 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!