Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent error during scanning - Could not decode (...) #123

Open
larsyngvelundin opened this issue Nov 15, 2023 · 0 comments
Open

Intermittent error during scanning - Could not decode (...) #123

larsyngvelundin opened this issue Nov 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@larsyngvelundin
Copy link
Collaborator

Intermittently when trying to get the symbol from ERC20 contracts, we get these errors:

Traceback (most recent call last):
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\web3\contract\utils.py", line 111, in call_contract_function
    output_data = w3.codec.decode(output_types, return_data)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\codec.py", line 145, in decode
    return decoder(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 129, in __call__
    return self.decode(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_utils\functional.py", line 45, in inner
    return callback(fn(*args, **kwargs))
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 175, in decode
    yield decoder(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 129, in __call__
    return self.decode(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 144, in decode
    start_pos = decode_uint_256(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 129, in __call__
    return self.decode(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 199, in decode
    raw_data = self.read_data_from_stream(stream)
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\eth_abi\decoding.py", line 306, 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 "C:\Users\nok13\Documents\GitHub\WAGMI\main.py", line 100, in <module>
    start_scanner()
  File "C:\Users\nok13\Documents\GitHub\WAGMI\main.py", line 37, in start_scanner
    scanner.start()
  File "C:\Users\nok13\Documents\GitHub\WAGMI\modules\scanner\scanner_main.py", line 75, in start
    token2_symbol = token2.functions.symbol().call()
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\web3\contract\contract.py", line 461, in call
    return call_contract_function(
  File "C:\Users\nok13\Documents\GitHub\WAGMI\venv\lib\site-packages\web3\contract\utils.py", line 129, in call_contract_function
    raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not decode contract function call to symbol with return data: b'', output_types: ['string']

Function where it originates in our code seems to be token2.functions.symbol().call(), line 75, in scanner_main.py

@larsyngvelundin larsyngvelundin added the bug Something isn't working label Nov 15, 2023
@larsyngvelundin larsyngvelundin changed the title Intermittent error during scanning Intermittent error during scanning - Could not decode (...) Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant