Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

web3.exceptions.ContractLogicError: execution reverted: Unexpected error uniswapv3 EUROC USDC pair

オープン
#355 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

Start with the reported get_price_input call in the traceback and compare the EUROC/USDC token addresses and Uniswap version with the pool linked in the issue. The traceback points to _get_token_token_input_price in the installed uniswap.py; inspect the corresponding project code and tests, if present. Done means the reported route returns a price or the cause and supported route are documented.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug
A pool exists for EUROC/EURC and USDC on Eth newtwork
https://info.uniswap.org/#/pools/0x95dbb3c7546f22bce375900abfdd64a4e5bd73d6

I can call USDC to ETH but for rate = uniswap.get_price_input on EUROC I get the below error
address used is
"0x1abaea1f7c830bd89acc67ec4af516284b1bc33c"

To Reproduce


from uniswap import Uniswap
from web3 import Web3


# EUROC==> USDC
def rates1():
    uniswap = Uniswap(
        version=2,
        provider="https://mainnet.infura.io/v3/xxxxx",
        address=None,
        private_key=None,
    )

    exchange_fee = Decimal(from_wei(250000 * uniswap.w3.eth.gas_price, 18))

    amount = to_wei(1, 6)
    rate = uniswap.get_price_input(
        Web3.to_checksum_address(
            "0x1abaea1f7c830bd89acc67ec4af516284b1bc33c"
        ),  # EUROC Add
        Web3.to_checksum_address(
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
        ),  # USDC Add
        amount,
    )
    rate = Decimal(from_wei(rate, 6))
    print("Fee: ", exchange_fee)
    print("Rate: ", rate)


def to_wei(amount, decimal_places):
    return amount * 10**decimal_places


def from_wei(amount, decimal_places):
    return amount / 10**decimal_places
    ```

Steps to reproduce the behavior. Ideally, you can provide a code example demonstrating the issue (including the Uniswap version, tokens/route, and network used).

**Expected behavior**
expect to get the price

**Additional context**
Add any other context about the problem here, such as a transaction ID demonstrating the problem.
full stack trace is below

0|lightecho | [2023-10-27 09:30:31,775 api.py:458 ERROR] Exception raised by task: <coroutine object as_completed.._wait_for_one at 0x7f60b6712b20>
0|lightecho | Traceback (most recent call last):
0|lightecho | File "/home/lightecho/lightecho/./api/api.py", line 456, in ws_rates
0|lightecho | result = await task
0|lightecho | File "/usr/lib/python3.10/asyncio/tasks.py", line 571, in _wait_for_one
0|lightecho | return f.result() # May raise f.exception().
0|lightecho | File "/home/lightecho/lightecho/./api/api.py", line 167, in cached_rates
0|lightecho | result = await mod.rates(
0|lightecho | File "/home/lightecho/lightecho/api/integrations/uniswap_v3.py", line 118, in rates
0|lightecho | rate = await get_rate(
0|lightecho | File "/home/lightecho/lightecho/api/integrations/uniswap_v3.py", line 165, in get_rate
0|lightecho | rate = uniswap.get_price_input(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/uniswap/uniswap.py", line 247, in get_price_input
0|lightecho | return self._get_token_token_input_price(token0, token1, qty, fee, route)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/uniswap/uniswap.py", line 351, in _get_token_token_input_price
0|lightecho | ).call()
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/contract/contract.py", line 305, in call
0|lightecho | return call_contract_function(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/contract/utils.py", line 96, in call_contract_function
0|lightecho | return_data = w3.eth.call(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/eth/eth.py", line 256, in call
0|lightecho | return self._durin_call(transaction, block_identifier, state_override)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/eth/eth.py", line 275, in _durin_call
0|lightecho | return self._call(transaction, block_identifier, state_override)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/module.py", line 75, in caller
0|lightecho | result = w3.manager.request_blocking(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 321, in request_blocking
0|lightecho | return self.formatted_response(
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 282, in formatted_response
0|lightecho | apply_error_formatters(error_formatters, response)
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/manager.py", line 99, in apply_error_formatters
0|lightecho | formatted_resp = pipe(response, error_formatters)
0|lightecho | File "cytoolz/functoolz.pyx", line 666, in cytoolz.functoolz.pipe
0|lightecho | File "cytoolz/functoolz.pyx", line 641, in cytoolz.functoolz.c_pipe
0|lightecho | File "/home/lightecho/lightecho/.venv/lib/python3.10/site-packages/web3/_utils/contract_error_handling.py", line 161, in raise_contract_logic_error_on_revert
0|lightecho | raise ContractLogicError(message, data=data)
0|lightecho | web3.exceptions.ContractLogicError: execution reverted: Unexpected error

主要言語
Python
スター
1k
フォーク
373
平均マージ
2日 6時間
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uniswap-python/uniswap-python のほかの issue

uniswap-python/uniswap-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。