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

Add Hardhat-style messages to errors #2862

Closed
ricmoo opened this issue Apr 5, 2022 · 2 comments
Closed

Add Hardhat-style messages to errors #2862

ricmoo opened this issue Apr 5, 2022 · 2 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@ricmoo
Copy link
Member

ricmoo commented Apr 5, 2022

Describe the Feature

There are several matcher libraries supported by hardhat which rely on string matching, which is lost during error handling in ethers.

Adding the necessary strings to error messages for CALL_EXCEPTION errors will enable those libraries to work.

For Error(string) = "foobar": VM Exception while processing transaction: reverted with reason string 'foobar'

For no error bytes: Transaction reverted without a reason string

For Panic(uint256) = 1: VM Exception while processing transaction: reverted with panic code 0x1 (Assertion error). There are other 8 panic codes we support though.

Code Example

No response

@ricmoo ricmoo added the enhancement New feature or improvement. label Apr 5, 2022
@ricmoo ricmoo added the on-deck This Enhancement or Bug is currently being worked on. label Apr 12, 2022
ricmoo added a commit that referenced this issue Apr 13, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@ricmoo
Copy link
Member Author

ricmoo commented Apr 13, 2022

This has been added in 5.6.3, if anyone is using the latest hardhat and matchers that aren't working, please re-open and let me know.

Thanks! :)

@ricmoo ricmoo closed this as completed Apr 13, 2022
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Apr 13, 2022
@Samboy76
Copy link

I´m on ethers 5.7.2 and got Error: VM Exception while processing transaction: reverted with panic code 0x1 (Assertion error) when I attempted to perform a swap function on DEX smart contract router. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants