question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: invalid literal for int() with base 10: 'LID'`

See original GitHub issue

Environment information

  • brownie Version: master
  • ganache-cli Version: v6.12.1
  • solc Version: 0.6.12
  • Python Version: 3.9
  • OS: linux

What was wrong?

code compiles fine before

 File "/usr/local/lib/python3.8/dist-packages/brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "/usr/local/lib/python3.8/dist-packages/brownie/_cli/console.py", line 47, in main
    active_project = project.load()
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/main.py", line 702, in load
    return Project(name, project_path)
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/main.py", line 164, in __init__
    self.load()
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/main.py", line 217, in load
    self._compile(changed, self._compiler_config, False)
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/main.py", line 90, in _compile
    build_json = compiler.compile_and_format(
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/compiler/__init__.py", line 146, in compile_and_format
    build_json.update(generate_build_json(input_json, output_json, compiler_data, silent))
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/compiler/__init__.py", line 309, in generate_build_json
    build_json[contract_name] = solidity._get_unique_build_json(
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/compiler/solidity.py", line 246, in _get_unique_build_json
    pc_map, statement_map, branch_map = _generate_coverage_data(
  File "/usr/local/lib/python3.8/dist-packages/brownie/project/compiler/solidity.py", line 349, in _generate_coverage_data
    pc += int(pc_list[-1]["op"][4:])
ValueError: invalid literal for int() with base 10: 'LID'

How can it be fixed?

no idea how to debug

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
benjyzcommented, Dec 5, 2020

the failure came from this contract https://github.com/rapidtrade-io/launchswap/blob/master/contracts/PCert.sol

compiled fine on ropsten and remix, so wasn’t sure where to start

0reactions
iamdefinitelyahumancommented, Jan 16, 2021

Took a look, this is happening because under certain conditions the solidity source map is too long. I’m not sure why solidity does this, but Brownie now handles it gracefully.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: invalid literal for int() with base 10: '' - Stack Overflow
The reason is that you are getting an empty string or a string as an argument into int. Check if it ...
Read more >
ValueError: invalid literal for int() with base 10
The error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that's not an...
Read more >
ValueError: invalid literal for int() with base 10 in Python
The Python "ValueError: invalid literal for int() with base 10" occurs when we pass a string that cannot be directly converted to an...
Read more >
Python ValueError: invalid literal for int() with base 10
This error can frequently occur when converting user-input to an integer-type using the int() function. This problem happens because Python stores the input...
Read more >
Python ValueError: invalid literal for int() with base 10 Solution
The Python ValueError: invalid literal for int() with base 10 error is raised when you try to convert a string value that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found