Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Labels
bugSomething isn't working
@kthenurseone

Description

@kthenurseone

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp