6 Comments
May 5, 2022Liked by BowTiedDevil

Sorry for my newbie doubt. I gest the following error...

File "snowsight_example.py", line 152, in <module>

cra = Erc20Token(address=CRA_CONTRACT_ADDRESS)

NameError: name 'Erc20Token' is not defined

Expand full comment
author

Do a 'git clone' of the degenbot repo into this same directory, and include "from degenbot import *" at the top.

This makes all of my helper functions and classes available, including the Erc20Token classes.

https://github.com/BowTiedDevil/degenbot/

Expand full comment
May 5, 2022Liked by BowTiedDevil

Contracts loaded:

• CRA (CRA)

• WAVAX (Wrapped AVAX)

Fetching source of 0x60aE616a2155Ee3d9A68541Ba4544862310933d4 from api.snowtrace.io...

/home/panchato/environments/myfirstapp/lib/python3.8/site-packages/brownie/network/contract.py:1180: BrownieCompilerWarning: 0x60aE616a2155Ee3d9A68541Ba4544862310933d4: Locally compiled and on-chain bytecode do not match!

warnings.warn(

TraderJoe

• Token 0: CRA - Reserves: 4154454110915204376855604

• Token 1: WAVAX - Reserves: 25738686708864866417322

Traceback (most recent call last):

File "snowsight_example.py", line 166, in <module>

asyncio.run(main())

File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run

return loop.run_until_complete(main)

File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete

return future.result()

File "snowsight_example.py", line 106, in main

await asyncio.create_task(watch_pending_transactions())

File "snowsight_example.py", line 45, in watch_pending_transactions

async for websocket in websockets.connect(

TypeError: 'async for' requires an object with __aiter__ method, got Connect

Expand full comment
May 5, 2022·edited May 5, 2022Liked by BowTiedDevil

Now I get this. Thank you very much for your time and help!! Cheers from Chile!!

Expand full comment
author

'pip install websockets==10.3'

The older websockets library doesn't support the for loop structure from my code.

Expand full comment
May 5, 2022Liked by BowTiedDevil

It worked!!! You are a genius!!!

Expand full comment