invalid token address for eth
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
Start with examples/price_impact.py and trace the v3 call to estimate_price_impact, which fails when get_token receives the zero address. Check how the example sets the ETH input token and how that address is handled. Done means the ETH-to-VXV example returns a price impact without raising InvalidToken.
由索引模型根據 Issue 內容生成。
描述
To Reproduce
Run the code in examples/price_impact.py
Expected behavior
Get the price impact of a swap eth to vxv
** Actual behaviour **
$ PROVIDER='http://127.0.0.1:8545' python test.py
Impact for buying VXV on v2 with 10.0 USDT: 100%
Impact for buying VXV on v2 with 13900.0 USDT: 100%
Exception occurred while trying to get token 0x0000000000000000000000000000000000000000: Could not transact with/call contract function, is contract deployed correctly and chain synced?
Traceback (most recent call last):
File "/path/.local/lib/python3.10/site-packages/web3/contract.py", line 1513, in call_contract_function
output_data = web3.codec.decode_abi(output_types, return_data)
File "/path/.local/lib/python3.10/site-packages/eth_abi/codec.py", line 181, in decode_abi
return decoder(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
return self.decode(stream)
File "/path/.local/lib/python3.10/site-packages/eth_utils/functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 173, in decode
yield decoder(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
return self.decode(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 142, in decode
start_pos = decode_uint_256(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
return self.decode(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 198, in decode
raw_data = self.read_data_from_stream(stream)
File "/path/.local/lib/python3.10/site-packages/eth_abi/decoding.py", line 305, in read_data_from_stream
raise InsufficientDataBytes(
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/path/.local/lib/python3.10/site-packages/uniswap/uniswap.py", line 1217, in get_token
_name = token_contract.functions.name().call()
File "/path/.local/lib/python3.10/site-packages/web3/contract.py", line 957, in call
return call_contract_function(
File "/path/.local/lib/python3.10/site-packages/web3/contract.py", line 1530, in call_contract_function
raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/test.py", line 62, in <module>
eth_to_vxv_v3()
File "/path/test.py", line 52, in eth_to_vxv_v3
impact = uniswap.estimate_price_impact(eth, vxv, qty, fee=10000)
File "/path/.local/lib/python3.10/site-packages/uniswap/uniswap.py", line 1351, in estimate_price_impact
cost_amount / (amount_in / (10 ** self.get_token(token_in).decimals))
File "/path/.local/lib/python3.10/site-packages/uniswap/uniswap.py", line 1224, in get_token
raise InvalidToken(address)
uniswap.exceptions.InvalidToken: Invalid token address: 0x0000000000000000000000000000000000000000
- 主要語言
- Python
- 星號
- 1k
- 分支
- 373
- 平均合併
- 2 天 6 小時
- 30 天內合併 PR
- 6
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
uniswap-python/uniswap-python 的其他 Issue
-
Broken links in the docs可能已有人在做 @ankush-dev-eng 於 1 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 78/100
uniswap-python/uniswap-python#487 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 10/100
uniswap-python/uniswap-python#492 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 35/100
uniswap-python/uniswap-python#415 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 20/100
uniswap-python/uniswap-python#405 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
uniswap-python/uniswap-python#404 · 1 個 reaction ·
維護者通常 1 天內回覆
查看 uniswap-python/uniswap-python 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
jbacalso24/mimry#291 ·
維護者通常 1 天內回覆
-
good first issue
難度 2/5 1 小時以內 新手友好度 82/100
eli-alvarado/us-watchlist-alerts#14 ·
維護者通常 1 天內回覆
-
from-review-extraction python severity:nit
難度 2/5 1-3 小時 新手友好度 80/100
LearningCircuit/local-deep-research#7462 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
cathrynlavery/diagram-design#441 ·
維護者通常 2 天內回覆
-
[Cleanup] Include the public header in work_split.cpp可能已有人在做 @blozano-tt 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
tenstorrent/tt-metal#60850 ·
維護者通常 1 天內回覆