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

Error when trying to get_pool_state#294

AnsweredbyKeremP
m4sdr asked this question inQ&A
Discussion options

This is the error it shows:
Traceback (most recent call last): File "/Users/username/Desktop/Python_Proyect/main.py", line 15, in <module> s_info = Uniswap.get_pool_state(self=uniswap, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uniswap/decorators.py", line 65, in check_version return f(self, *args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/uniswap/uniswap.py", line 1701, in get_pool_state liquidity = pool.functions.liquidity().call() AttributeError: 'str' object has no attribute 'functions'

Im new to python can you help me to solve this.

You must be logged in to vote

Hi, would you kindly be able to provide a full code example? My first instinct is that you are passing an address to the function rather than a contract instance.

Replies: 1 comment 2 replies

Comment options

Hi, would you kindly be able to provide a full code example? My first instinct is that you are passing an address to the function rather than a contract instance.

You must be logged in to vote
2 replies
@m4sdr
Comment options

Im running this
s_info = Uniswap.get_pool_state(self=uniswap, pool='0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640')

@KeremP
Comment options

Awesome, so the pool param must be a Contract instance of a uniswap pool. You can use theget_pool_instance() and pass the output toget_pool_state()

Answer selected bym4sdr
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@m4sdr@KeremP

[8]ページ先頭

©2009-2025 Movatter.jp