You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to trade on the Ethereum L2 base but I am unable to create a transaction/retrieve a clear error statement. I made some additions to the constants within the project which allowed me to connect to my base wallet and print out token amounts but I am unable to exchange anything.
The error the code produces is :
Traceback (most recent call last):
File "C:\Users\adeye\Desktop\Test Repo\examples\BuyTest.py", line 44, in
buy_token(usdc,0.00003)
File "C:\Users\adeye\Desktop\Test Repo\examples\BuyTest.py", line 26, in buy_token
tx = uniswap.make_trade(eth, token_address,to_wei(eth_amount,'ether'), eth_amount_wei)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\decorators.py", line 45, in approved
return method(self, *args, **kwargs)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 469, in make_trade
return self._eth_to_token_swap_input(
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 555, in _eth_to_token_swap_input
(1 - slippage) * self._get_eth_token_input_price(output_token, qty, fee)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 281, in _get_eth_token_input_price
qty, [self.get_weth_address(), token]
File "C:\Users\adeye\Desktop\Test Repo\uniswap\decorators.py", line 72, in check_version
return f(self, *args, **kwargs)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 1624, in get_weth_address
address: ChecksumAddress = self.router.functions.WETH().call()
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\contract\contract.py", line 305, in call
return call_contract_function(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\contract\utils.py", line 96, in call_contract_function
return_data = w3.eth.call(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\eth\eth.py", line 260, in call
return self._durin_call(transaction, block_identifier, state_override)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\eth\eth.py", line 279, in _durin_call
return self._call(transaction, block_identifier, state_override)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\module.py", line 75, in caller
result = w3.manager.request_blocking(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 329, in request_blocking
return self.formatted_response(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 290, in formatted_response
apply_error_formatters(error_formatters, response)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 103, in apply_error_formatters
formatted_resp = pipe(response, error_formatters)
File "cytoolz\functoolz.pyx", line 680, in cytoolz.functoolz.pipe
File "cytoolz\functoolz.pyx", line 655, in cytoolz.functoolz.c_pipe
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3_utils\error_formatters_utils.py", line 165, in raise_contract_logic_error_on_revert
raise ContractLogicError("execution reverted", data=data)
web3.exceptions.ContractLogicError: ('execution reverted', 'no data')
I understand that at some on in trying to interact with the contract the script fails but I can't pinpoint where the issue may be.
Any help/explanations will be much appreciated!!!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to trade on the Ethereum L2 base but I am unable to create a transaction/retrieve a clear error statement. I made some additions to the constants within the project which allowed me to connect to my base wallet and print out token amounts but I am unable to exchange anything.
File "C:\Users\adeye\Desktop\Test Repo\examples\BuyTest.py", line 44, in
buy_token(usdc,0.00003)
File "C:\Users\adeye\Desktop\Test Repo\examples\BuyTest.py", line 26, in buy_token
tx = uniswap.make_trade(eth, token_address,to_wei(eth_amount,'ether'), eth_amount_wei)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\decorators.py", line 45, in approved
return method(self, *args, **kwargs)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 469, in make_trade
return self._eth_to_token_swap_input(
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 555, in _eth_to_token_swap_input
(1 - slippage) * self._get_eth_token_input_price(output_token, qty, fee)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 281, in _get_eth_token_input_price
qty, [self.get_weth_address(), token]
File "C:\Users\adeye\Desktop\Test Repo\uniswap\decorators.py", line 72, in check_version
return f(self, *args, **kwargs)
File "C:\Users\adeye\Desktop\Test Repo\uniswap\uniswap.py", line 1624, in get_weth_address
address: ChecksumAddress = self.router.functions.WETH().call()
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\contract\contract.py", line 305, in call
return call_contract_function(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\contract\utils.py", line 96, in call_contract_function
return_data = w3.eth.call(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\eth\eth.py", line 260, in call
return self._durin_call(transaction, block_identifier, state_override)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\eth\eth.py", line 279, in _durin_call
return self._call(transaction, block_identifier, state_override)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\module.py", line 75, in caller
result = w3.manager.request_blocking(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 329, in request_blocking
return self.formatted_response(
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 290, in formatted_response
apply_error_formatters(error_formatters, response)
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3\manager.py", line 103, in apply_error_formatters
formatted_resp = pipe(response, error_formatters)
File "cytoolz\functoolz.pyx", line 680, in cytoolz.functoolz.pipe
File "cytoolz\functoolz.pyx", line 655, in cytoolz.functoolz.c_pipe
File "C:\Users\adeye\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\web3_utils\error_formatters_utils.py", line 165, in raise_contract_logic_error_on_revert
raise ContractLogicError("execution reverted", data=data)
web3.exceptions.ContractLogicError: ('execution reverted', 'no data')
I understand that at some on in trying to interact with the contract the script fails but I can't pinpoint where the issue may be.
Any help/explanations will be much appreciated!!!
Beta Was this translation helpful? Give feedback.
All reactions