GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Could not transact with/call contract function, is contract deployed correctly and chain synced? · Issue #348 · uniswap-python/uniswap-python

Could not transact with/call contract function, is contract deployed correctly and chain synced? #348

New issue
Copy link
New issue
Copy link
Open
Open
Could not transact with/call contract function, is contract deployed correctly and chain synced?#348
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@kthenurseone
kthenurseone
opened on Sep 18, 2023
Issue body actions

My code is:
`

        print(f"Buying token with {address}")
        w3 = web3.Web3(web3.HTTPProvider(mySettings["RPC"]))
        w3.middleware_onion.inject(web3.middleware.geth_poa_middleware, layer=0)
        version = int(mySettings["VERSION"])
        provider = mySettings["RPC"]
        uniswap = Uniswap(address=address, private_key=private_key, version=version,default_slippage=1, provider=provider, web3=w3)
        token1 = to_checksum_address(mySettings["TOKEN1"])
        token2 = to_checksum_address(mySettings["TOKEN2"])

        # print(uniswap.get_price_input(token1, token2, 10**18))

        token1Balance = uniswap.get_token_balance(mySettings["TOKEN1"])-20
        print("Token1: ", token1Balance)




        # print(int(myETHBalance/100))
        uniswap.make_trade(token1, token2, token1Balance)
        time.sleep(int(mySettings["DELAY"]))

        print(f"Selling token with {address}")
        token2Balance = uniswap.get_token_balance(mySettings["TOKEN2"])
        print("Token2: ",token2Balance)


        uniswap.make_trade(token2, token1, token2Balance)
        time.sleep(int(mySettings["DELAY"]))`

and my settings are:

[SETTINGS]
TOKEN1= 0x55d398326f99059ff775485246999027b3197955
TOKEN2 = 0x643D89FBe699068353D24acf55Eb33366d57F533
VERSION = 3
RPC = https://binance.llamarpc.com
DELAY = 45

when I try to run the program it gives that error:

Web3 is connected: True Buying token with 0xFC2E975cd81807983d457A1732d887A55Ac8b36e Token1: 13138442028139619270 No fee set, assuming 0.3% Could not transact with/call contract function, is contract deployed correctly and chain synced?

Activity

  1. kthenurseone
    added
    bugSomething isn't workingSomething isn't working
    on Sep 18, 2023
  2. kthenurseone commented on Sep 18, 2023

    @kthenurseone
    kthenurseone
    on Sep 18, 2023
    Author
    More actions

    +++ update:
    I made a buy manually and I saw that router is universal router. and I updated the code like this:
    uniswap = Uniswap(router_contract_addr="0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",address=address, private_key=private_key, version=version,default_slippage=1, provider=provider, web3=w3)

    but I still get the same error as I get before..

  3. liquid-8 commented on Sep 20, 2023

    @liquid-8
    liquid-8
    on Sep 20, 2023
    Member
    More actions

    There is no support for the universal router. You can use a regular v3 router if it is deployed on BSC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.