1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Trying to add liquidity on uniswap v3 via web3py

Discussão em 'Python' iniciado por Stack, Setembro 15, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying this code on Ropsten, it but keeps failing:

    contract_instance = w3.eth.contract(address="0xC36442b4a4522E871399CD717aBDD847Ab11FE88", abi=liq_ABI)

    tx_hash = contract_instance.functions.mint(
    (
    '0x31F42841c2db5173425b5223809CF3A38FEde360',
    '0xc778417E063141139Fce010982780140Aa0cD5Ab',
    3000,
    49548,
    50549,
    w3.toWei(0.001,'ether'),
    w3.toWei(0.17,'ether'),
    w3.toWei(0,'ether'),
    w3.toWei(0,'ether'),
    wallet_address,
    round(time.time()) + 60*20,
    )
    ).buildTransaction({
    'from': wallet_address,
    'chainId': 3,
    'gas': 300000,
    'gasPrice': w3.toWei(500, 'gwei'),
    'nonce': w3.eth.getTransactionCount(wallet_address),
    'value': Web3.toWei(0, 'ether')
    })
    print(tx_hash)
    signed_tx = w3.eth.account.signTransaction(tx_hash, private_key=wallet_key)
    tx = w3.eth.sendRawTransaction(signed_tx.rawTransaction)


    Failed transaction: https://ropsten.etherscan.io/tx/0xc2f3d6ffff164df331dd4b46fc65dadc5dba8f135f6e13ef1cd383a73a2d0c4b

    Continue reading...

Compartilhe esta Página