Giter VIP home page Giter VIP logo

data-misc's People

Contributors

bh2smith avatar fleupold avatar gentrexha avatar josojo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

0xrobin bh2smith

data-misc's Issues

OverflowError for specific address while fetching token details

I've just stumbled upon that self.symbol = token_contract.caller.symbol() is failing for the address 0x8e0E57DCb1ce8d9091dF38ec1BfC3b224529754A.

Full error traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/gent/Projects/data-misc/src/missing_tokens.py", line 144, in <module>
    run_missing_tokens(chain=blockchain)
  File "/home/gent/Projects/data-misc/src/missing_tokens.py", line 122, in run_missing_tokens
    token_details[token] = TokenDetails(address=token, w3=w3)
  File "/home/gent/Projects/data-misc/src/missing_tokens.py", line 31, in __init__
    self.symbol = token_contract.caller.symbol()
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/web3/contract.py", line 1477, in call_function
    return fn(*args, **kwargs).call(transaction, block_identifier)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/web3/contract.py", line 970, in call
    return call_contract_function(
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/web3/contract.py", line 1537, in call_contract_function
    output_data = web3.codec.decode(output_types, return_data)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/codec.py", line 210, in decode
    return decoder(stream)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_utils/functional.py", line 45, in inner
    return callback(fn(*args, **kwargs))
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 173, in decode
    yield decoder(stream)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 144, in decode
    stream.push_frame(start_pos)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 95, in push_frame
    self.seek_in_frame(0)
  File "/home/gent/Projects/data-misc/venv/lib/python3.10/site-packages/eth_abi/decoding.py", line 84, in seek_in_frame
    self.seek(self._total_offset + pos, *args, **kwargs)
OverflowError: Python int too large to convert to C ssize_t

Make Batch Requests for Token Data

This is analogous to what we have done here in the token allocation project (batching together our RPC requests)

https://github.com/cowprotocol/token-allocation/blob/b969f3e2ad48041f7459fed4d80527bb188f232f/src/fetch/contracts.py#L47-L75

With the most relevant block of code being:

        for index, eth_address in enumerate(addresses):
            request_data.append({
                "jsonrpc": "2.0",
                "method": "eth_getCode",
                "params": [eth_address, "latest"],
                "id": index
            })
        response = requests.post(self.node_url, json=request_data)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.