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.

Support Solidity panic codes in the RuntimeError class

See original GitHub issue

Here revert reasons are processed. This currently only understands the revert strings (which have a signature of Error(string)). It would be nice to also support panic codes (with a signature of Panic(uint256)).

See https://docs.soliditylang.org/en/v0.8.0/control-structures.html#panic-via-assert-and-error-via-require for more information.

I think ganache should return panic codes as a numeric value for the moment.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
haltman-atcommented, Feb 11, 2022

FWIW, here’s the Solidity documentation of the panic codes, and here’s the table of panic codes that the debugger uses for interpreting them. 😃 (And which Truffle Contract would presumably also use if we added support for that there…)

1reaction
davidmurdochcommented, Feb 10, 2022

Just realized this may be related to some changes plan to make to our eth_call error message strings that would provide additional information over what we give now. @MicaiahReid, I couldn’t find an issue for the new error strings we were talking about adding; they might all map to these specific panic codes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: VM Exception while processing transaction: revert.
This error happens when a function call jumps out of bounds (e.g array out of bounds). This is done to punish the caller...
Read more >
Truffle Error- VM Exception while processing transaction: revert
I am new in this field.What is this error mean and why this error comes??Any one tell me What I mistake in code??....
Read more >
Getting VM Exception while processing transaction: revert error
Unlike web3, Truffle doesn't use the methods keyword. The call fails because it's trying to access (non-existing) methods property of the ...
Read more >
Expressions and Control Structures - Solidity
Solidity also supports exception handling in the form of try / catch ... The error code supplied with the error data indicates the...
Read more >
How to Build a Full Stack NFT Marketplace - V2 (2022)
Building an NFT marketplace with Polygon, Next.js, Tailwind, Solidity, Hardhat, Ethers.js, and IPFS. To view the video course for this tutorial, ...
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