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.

AbiCoder: decode revert errors

See original GitHub issue

Related to https://github.com/ethers-io/ethers.js/issues/368, https://github.com/ethereum/web3.js/issues/1707.

Even though transaction receipts do not give us revert error strings, eth_calls do, and it would be nice if the AbiCoder knew how to decode them (and likely, throw an error with the string).

In particular, there was a situation where I wanted to query a contract for boolean value. Some times, this check reverts (perhaps the contract is not completely done being set up yet), but ethers’ AbiCoder takes the 0x08c379a0...<revert string> result from the eth_call and says, yes, that’s a boolean (and a true one at that!).

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
nividacommented, Oct 19, 2019

@ricmoo We haven’t implemented the revert handling at all in web3.js. I will prioritize this open task higher.

Btw.: 1.2.1 is also not using the latest version of the AbiCoder but it’s on our todo list (we have to update all the ABI related test cases and some utility functions (adding of the correct padding)).

1reaction
ricmoocommented, Nov 20, 2019

I’m going to close this now, as it isn’t related to ethers, I don’t believe. But please feel free to re-open. 😃

Thanks! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with abi.decode on output from reverted functions
I am struggling to figure out the abi.decode function when using it to decode the bytes coming as output from a reverted low...
Read more >
Solidity v0.8.4 is here - Adds custom structured errors and more!
Calldata decoding is not affected. The bug is present in all prior versions of ABI coder v2 and was assigned a severity level...
Read more >
Parameter Encoding and Decoding - TRON Developer Hub
This article mainly introduces how to encode and decode parameters when triggering a smart contract in the Tron network. The encoding and decoding...
Read more >
Interface - Ethers.js
The Interface Class abstracts the encoding and decoding required to interact with ... will automatically decode errors if the data represents a revert....
Read more >
Decode ETH ABI Binary Data into Readable Values - Moesif
An online tool for developers of Ethereum DApps. Quickly decode hex values from Ethereum binary transactions to human readable values using smart contract ......
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