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

111
Vistas
addLiquidity() function fails on UniswapV2 on local ganache instance?

addLiquidity() function reverts without any reason on local development instance of ganache, any ideas why this might be happening?

Some background:

  • I have forked the UniswapV2Factory and UniswapV2Router02 and deployed on ganache.
  • I have created 2 ERC20 tokens, and created a pair (via factory.createPair()) for them.
  • Minted both ERC20 tokens to my address.
  • I have approved token amounts to the router contract address (via erc20.approve() function)

This is how I am calling the addLiquidity Function

const blockNumber = await web3.eth.getBlockNumber();
const block = await web3.eth.getBlock(blockNumber);
const timestamp = block.timestamp + 300;

await router.addLiquidity(
    ERC20_TOKEN_1_ADDRESS,
    ERC20_TOKEN_2_ADDRESS,
    web3.utils.toWei('1', 'ether'),
    web3.utils.toWei('1', 'ether'),
    web3.utils.toWei('0.001', 'ether'),
    web3.utils.toWei('0.001', 'ether'),
    OWNER_ADDRESS,
    timestamp,
    { gas: 4000000 }
)
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